From 7f5b6753f54f4dbdcb5cd411f722657c8ba6f1c6 Mon Sep 17 00:00:00 2001
From: Andreas Schildbach Represents the "getaddr" P2P protocol message, which requests network {@link AddressMessage}s from a peer. Not to
- * be confused with {@link LegacyAddress} which is sort of like an account number.
Instances of this class are not safe for use by multiple threads.
*/ diff --git a/core/src/main/java/org/bitcoinj/crypto/DeterministicKey.java b/core/src/main/java/org/bitcoinj/crypto/DeterministicKey.java index 84a8c660..a4599d17 100644 --- a/core/src/main/java/org/bitcoinj/crypto/DeterministicKey.java +++ b/core/src/main/java/org/bitcoinj/crypto/DeterministicKey.java @@ -617,7 +617,7 @@ public class DeterministicKey extends ECKey { @Override public void formatKeyWithAddress(boolean includePrivateKeys, @Nullable KeyParameter aesKey, StringBuilder builder, NetworkParameters params) { - final LegacyAddress address = LegacyAddress.fromKey(params, this); + final Address address = LegacyAddress.fromKey(params, this); builder.append(" addr:").append(address); builder.append(" hash160:").append(Utils.HEX.encode(getPubKeyHash())); builder.append(" (").append(getPathAsString()).append(")\n"); diff --git a/core/src/main/java/org/bitcoinj/protocols/payments/PaymentProtocol.java b/core/src/main/java/org/bitcoinj/protocols/payments/PaymentProtocol.java index 5f8a4e71..f583f25e 100644 --- a/core/src/main/java/org/bitcoinj/protocols/payments/PaymentProtocol.java +++ b/core/src/main/java/org/bitcoinj/protocols/payments/PaymentProtocol.java @@ -66,7 +66,7 @@ public class PaymentProtocol { * @return created payment request, in its builder form */ public static Protos.PaymentRequest.Builder createPaymentRequest(NetworkParameters params, - @Nullable Coin amount, LegacyAddress toAddress, @Nullable String memo, @Nullable String paymentUrl, + @Nullable Coin amount, Address toAddress, @Nullable String memo, @Nullable String paymentUrl, @Nullable byte[] merchantData) { return createPaymentRequest(params, ImmutableList.of(createPayToAddressOutput(amount, toAddress)), memo, paymentUrl, merchantData); @@ -292,7 +292,7 @@ public class PaymentProtocol { * @return created payment message */ public static Protos.Payment createPaymentMessage(ListA transaction can have a fee attached, which is defined as the difference between the input values
diff --git a/core/src/main/java/org/bitcoinj/wallet/Wallet.java b/core/src/main/java/org/bitcoinj/wallet/Wallet.java
index cad62eca..e0a1eadd 100644
--- a/core/src/main/java/org/bitcoinj/wallet/Wallet.java
+++ b/core/src/main/java/org/bitcoinj/wallet/Wallet.java
@@ -27,7 +27,6 @@ import net.jcip.annotations.*;
import org.bitcoinj.core.listeners.*;
import org.bitcoinj.core.Address;
import org.bitcoinj.core.AbstractBlockChain;
-import org.bitcoinj.core.LegacyAddress;
import org.bitcoinj.core.BlockChain;
import org.bitcoinj.core.BloomFilter;
import org.bitcoinj.core.Coin;
@@ -35,6 +34,7 @@ import org.bitcoinj.core.Context;
import org.bitcoinj.core.ECKey;
import org.bitcoinj.core.FilteredBlock;
import org.bitcoinj.core.InsufficientMoneyException;
+import org.bitcoinj.core.LegacyAddress;
import org.bitcoinj.core.Message;
import org.bitcoinj.core.NetworkParameters;
import org.bitcoinj.core.Peer;
@@ -469,7 +469,7 @@ public class Wallet extends BaseTaggableObject
/**
* Returns address for a {@link #currentKey(org.bitcoinj.wallet.KeyChain.KeyPurpose)}
*/
- public LegacyAddress currentAddress(KeyChain.KeyPurpose purpose) {
+ public Address currentAddress(KeyChain.KeyPurpose purpose) {
keyChainGroupLock.lock();
try {
maybeUpgradeToHD();
@@ -483,7 +483,7 @@ public class Wallet extends BaseTaggableObject
* An alias for calling {@link #currentAddress(org.bitcoinj.wallet.KeyChain.KeyPurpose)} with
* {@link org.bitcoinj.wallet.KeyChain.KeyPurpose#RECEIVE_FUNDS} as the parameter.
*/
- public LegacyAddress currentReceiveAddress() {
+ public Address currentReceiveAddress() {
return currentAddress(KeyChain.KeyPurpose.RECEIVE_FUNDS);
}
@@ -533,23 +533,23 @@ public class Wallet extends BaseTaggableObject
/**
* Returns address for a {@link #freshKey(org.bitcoinj.wallet.KeyChain.KeyPurpose)}
*/
- public LegacyAddress freshAddress(KeyChain.KeyPurpose purpose) {
- LegacyAddress key;
+ public Address freshAddress(KeyChain.KeyPurpose purpose) {
+ Address address;
keyChainGroupLock.lock();
try {
- key = keyChainGroup.freshAddress(purpose);
+ address = keyChainGroup.freshAddress(purpose);
} finally {
keyChainGroupLock.unlock();
}
saveNow();
- return key;
+ return address;
}
/**
* An alias for calling {@link #freshAddress(org.bitcoinj.wallet.KeyChain.KeyPurpose)} with
* {@link org.bitcoinj.wallet.KeyChain.KeyPurpose#RECEIVE_FUNDS} as the parameter.
*/
- public LegacyAddress freshReceiveAddress() {
+ public Address freshReceiveAddress() {
return freshAddress(KeyChain.KeyPurpose.RECEIVE_FUNDS);
}
@@ -570,9 +570,9 @@ public class Wallet extends BaseTaggableObject
* Returns only the addresses that have been issued by {@link #freshReceiveKey()}, {@link #freshReceiveAddress()},
* {@link #currentReceiveKey()} or {@link #currentReceiveAddress()}.
*/
- public List