WalletTool: add support for the emptying out feature.

This commit is contained in:
Mike Hearn 2013-07-25 11:28:32 +02:00
parent 9e78268813
commit d0a431cd9c

View File

@ -431,6 +431,10 @@ public class WalletTool {
} }
} }
Wallet.SendRequest req = Wallet.SendRequest.forTx(t); Wallet.SendRequest req = Wallet.SendRequest.forTx(t);
if (t.getOutputs().size() == 1 && t.getOutput(0).getValue().equals(wallet.getBalance())) {
log.info("Emptying out wallet, recipient may get less than what you expect");
req.emptyWallet = true;
}
req.fee = fee; req.fee = fee;
if (allowUnconfirmed) { if (allowUnconfirmed) {
wallet.allowSpendingUnconfirmedTransactions(); wallet.allowSpendingUnconfirmedTransactions();