Wallet: use forEach() to add inputs to req.tx in completeTx()

This commit is contained in:
Sean Gilligan 2023-05-09 16:55:42 -07:00 committed by Andreas Schildbach
parent 74b7b11681
commit 9f76385c9d

View File

@ -4589,8 +4589,8 @@ public class Wallet extends BaseTaggableObject
log.info(" emptying {}", bestCoinSelection.totalValue().toFriendlyString()); log.info(" emptying {}", bestCoinSelection.totalValue().toFriendlyString());
} }
for (TransactionOutput output : bestCoinSelection.outputs()) bestCoinSelection.outputs()
req.tx.addInput(output); .forEach(req.tx::addInput);
if (req.emptyWallet) { if (req.emptyWallet) {
if (!adjustOutputDownwardsForFee(req.tx, bestCoinSelection, req.feePerKb, req.ensureMinRequiredFee)) if (!adjustOutputDownwardsForFee(req.tx, bestCoinSelection, req.feePerKb, req.ensureMinRequiredFee))