mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2024-11-20 18:22:12 +01:00
PrivateKeys: Send coins before stopping the PeerGroup.
This commit is contained in:
parent
1394f91d61
commit
5fb2b44d47
@ -75,13 +75,14 @@ public class PrivateKeys {
|
||||
peerGroup.addAddress(new PeerAddress(params, InetAddress.getLocalHost()));
|
||||
peerGroup.startAsync();
|
||||
peerGroup.downloadBlockChain();
|
||||
peerGroup.stopAsync();
|
||||
|
||||
// And take them!
|
||||
System.out.println("Claiming " + wallet.getBalance().toFriendlyString());
|
||||
wallet.sendCoins(peerGroup, destination, wallet.getBalance());
|
||||
|
||||
// Wait a few seconds to let the packets flush out to the network (ugly).
|
||||
Thread.sleep(5000);
|
||||
peerGroup.stopAsync();
|
||||
System.exit(0);
|
||||
} catch (ArrayIndexOutOfBoundsException e) {
|
||||
System.out.println("First arg should be private key in Base58 format. Second argument should be address " +
|
||||
|
Loading…
Reference in New Issue
Block a user