mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-07-31 20:11:23 +00:00
Fix just asking Wallet.doMaintenance() for if maintenance needs to be done wastes addresses.
This commit is contained in:
@@ -4522,7 +4522,8 @@ public class Wallet extends BaseTaggableObject implements Serializable, BlockCha
|
|||||||
for (TransactionOutput output : toMove.gathered) {
|
for (TransactionOutput output : toMove.gathered) {
|
||||||
rekeyTx.addInput(output);
|
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)) {
|
if (!adjustOutputDownwardsForFee(rekeyTx, toMove, Coin.ZERO, Transaction.REFERENCE_DEFAULT_MIN_TX_FEE)) {
|
||||||
log.error("Failed to adjust rekey tx for fees.");
|
log.error("Failed to adjust rekey tx for fees.");
|
||||||
return null;
|
return null;
|
||||||
|
Reference in New Issue
Block a user