mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-02-24 14:50:57 +01:00
Fix just asking Wallet.doMaintenance() for if maintenance needs to be done wastes addresses.
This commit is contained in:
parent
533489ed78
commit
cdc1a4ce99
1 changed files with 2 additions and 1 deletions
|
@ -4522,7 +4522,8 @@ public class Wallet extends BaseTaggableObject implements Serializable, BlockCha
|
|||
for (TransactionOutput output : toMove.gathered) {
|
||||
rekeyTx.addInput(output);
|
||||
}
|
||||
rekeyTx.addOutput(toMove.valueGathered, freshReceiveAddress());
|
||||
// When not signing, don't waste addresses.
|
||||
rekeyTx.addOutput(toMove.valueGathered, sign ? freshReceiveAddress() : currentReceiveAddress());
|
||||
if (!adjustOutputDownwardsForFee(rekeyTx, toMove, Coin.ZERO, Transaction.REFERENCE_DEFAULT_MIN_TX_FEE)) {
|
||||
log.error("Failed to adjust rekey tx for fees.");
|
||||
return null;
|
||||
|
|
Loading…
Add table
Reference in a new issue