diff options
author | Andrew Chow <github@achow101.com> | 2023-08-09 09:42:04 -0400 |
---|---|---|
committer | Andrew Chow <github@achow101.com> | 2023-09-12 12:14:31 -0400 |
commit | ad0c469d98c51931b98b7fd937c6ac3eeaed024e (patch) | |
tree | b775fbf14245282b5d276550d9eda1086c6251a5 /src/wallet/feebumper.cpp | |
parent | 07d3bdf4ebc06825ea24ab6f7c87aef6a22238c6 (diff) | |
download | bitcoin-ad0c469d98c51931b98b7fd937c6ac3eeaed024e.tar.xz |
wallet: Use CTxDestination in CRecipient rather than scriptPubKey
Diffstat (limited to 'src/wallet/feebumper.cpp')
-rw-r--r-- | src/wallet/feebumper.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/wallet/feebumper.cpp b/src/wallet/feebumper.cpp index 3720d144eb..d5ad638aa8 100644 --- a/src/wallet/feebumper.cpp +++ b/src/wallet/feebumper.cpp @@ -247,12 +247,12 @@ Result CreateRateBumpTransaction(CWallet& wallet, const uint256& txid, const CCo const auto& txouts = outputs.empty() ? wtx.tx->vout : outputs; for (size_t i = 0; i < txouts.size(); ++i) { const CTxOut& output = txouts.at(i); + CTxDestination dest; + ExtractDestination(output.scriptPubKey, dest); if (reduce_output.has_value() ? reduce_output.value() == i : OutputIsChange(wallet, output)) { - CTxDestination change_dest; - ExtractDestination(output.scriptPubKey, change_dest); - new_coin_control.destChange = change_dest; + new_coin_control.destChange = dest; } else { - CRecipient recipient = {output.scriptPubKey, output.nValue, false}; + CRecipient recipient = {dest, output.nValue, false}; recipients.push_back(recipient); } new_outputs_value += output.nValue; @@ -268,7 +268,7 @@ Result CreateRateBumpTransaction(CWallet& wallet, const uint256& txid, const CCo // Add change as recipient with SFFO flag enabled, so fees are deduced from it. // If the output differs from the original tx output (because the user customized it) a new change output will be created. - recipients.emplace_back(CRecipient{GetScriptForDestination(new_coin_control.destChange), new_outputs_value, /*fSubtractFeeFromAmount=*/true}); + recipients.emplace_back(CRecipient{new_coin_control.destChange, new_outputs_value, /*fSubtractFeeFromAmount=*/true}); new_coin_control.destChange = CNoDestination(); } |