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:
Mike Hearn 2013-02-04 14:47:21 +01:00
parent 37cb4205b3
commit 586f961b1b

View File

@ -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;