diff --git a/examples/src/main/java/org/bitcoinj/examples/ForwardingService.java b/examples/src/main/java/org/bitcoinj/examples/ForwardingService.java index a7d71123c..71767566b 100644 --- a/examples/src/main/java/org/bitcoinj/examples/ForwardingService.java +++ b/examples/src/main/java/org/bitcoinj/examples/ForwardingService.java @@ -74,7 +74,7 @@ public class ForwardingService { filePrefix = "forwarding-service"; } // Parse the address given as the first parameter. - forwardingAddress = LegacyAddress.fromBase58(params, args[0]); + forwardingAddress = Address.fromString(params, args[0]); System.out.println("Network: " + params.getId()); System.out.println("Forwarding address: " + forwardingAddress); diff --git a/examples/src/main/java/org/bitcoinj/examples/PrivateKeys.java b/examples/src/main/java/org/bitcoinj/examples/PrivateKeys.java index 6d93767d6..cab4fcf02 100644 --- a/examples/src/main/java/org/bitcoinj/examples/PrivateKeys.java +++ b/examples/src/main/java/org/bitcoinj/examples/PrivateKeys.java @@ -22,10 +22,10 @@ import org.bitcoinj.core.Base58; import org.bitcoinj.core.BlockChain; import org.bitcoinj.core.DumpedPrivateKey; import org.bitcoinj.core.ECKey; -import org.bitcoinj.core.LegacyAddress; import org.bitcoinj.core.NetworkParameters; import org.bitcoinj.core.PeerAddress; import org.bitcoinj.core.PeerGroup; +import org.bitcoinj.core.SegwitAddress; import org.bitcoinj.params.MainNetParams; import org.bitcoinj.script.Script; import org.bitcoinj.store.MemoryBlockStore; @@ -59,9 +59,9 @@ public class PrivateKeys { BigInteger privKey = Base58.decodeToBigInteger(args[0]); key = ECKey.fromPrivate(privKey); } - System.out.println("Address from private key is: " + LegacyAddress.fromKey(params, key).toString()); + System.out.println("Address from private key is: " + SegwitAddress.fromKey(params, key).toString()); // And the address ... - Address destination = LegacyAddress.fromBase58(params, args[1]); + Address destination = Address.fromString(params, args[1]); // Import the private key to a fresh wallet. Wallet wallet = Wallet.createDeterministic(params, Script.ScriptType.P2PKH);