mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2024-11-19 18:00:39 +01:00
Minor WalletTool fixes:
1) Print balance in friendly form 2) Use PeerGroup.stopAndWait() to avoid trying to close the store in parallel with network threads shutdown.
This commit is contained in:
parent
37cb4205b3
commit
586f961b1b
@ -416,7 +416,7 @@ public class WalletTool {
|
||||
Wallet.SendRequest req = Wallet.SendRequest.forTx(t);
|
||||
req.fee = fee;
|
||||
if (!wallet.completeTx(req)) {
|
||||
System.err.println("Insufficient funds: have " + wallet.getBalance());
|
||||
System.err.println("Insufficient funds: have " + Utils.bitcoinValueToFriendlyString(wallet.getBalance()));
|
||||
return;
|
||||
}
|
||||
try {
|
||||
@ -593,7 +593,7 @@ public class WalletTool {
|
||||
private static void shutdown() {
|
||||
try {
|
||||
if (peers == null) return; // setup() never called so nothing to do.
|
||||
peers.stop();
|
||||
peers.stopAndWait();
|
||||
saveWallet(walletFile);
|
||||
store.close();
|
||||
wallet = null;
|
||||
|
Loading…
Reference in New Issue
Block a user