diff options
author | furszy <matiasfurszyfer@protonmail.com> | 2022-12-18 20:16:19 -0300 |
---|---|---|
committer | furszy <matiasfurszyfer@protonmail.com> | 2023-04-05 09:32:39 -0300 |
commit | 2d112584e384de10021c64e4700455d71326824e (patch) | |
tree | f12d9e4d23c041223b7df4fae9f91194184613fb /src/wallet/spend.cpp | |
parent | d3a1c098e4b5df2ebbae20c6e390c3d783950e93 (diff) | |
download | bitcoin-2d112584e384de10021c64e4700455d71326824e.tar.xz |
coin selection: BnB, don't return selection if exceeds max allowed tx weight
Diffstat (limited to 'src/wallet/spend.cpp')
-rw-r--r-- | src/wallet/spend.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wallet/spend.cpp b/src/wallet/spend.cpp index f81e91bcba..57fb7202bb 100644 --- a/src/wallet/spend.cpp +++ b/src/wallet/spend.cpp @@ -566,7 +566,7 @@ util::Result<SelectionResult> ChooseSelectionResult(const CAmount& nTargetValue, // Maximum allowed weight int max_inputs_weight = MAX_STANDARD_TX_WEIGHT - (coin_selection_params.tx_noinputs_size * WITNESS_SCALE_FACTOR); - if (auto bnb_result{SelectCoinsBnB(groups.positive_group, nTargetValue, coin_selection_params.m_cost_of_change)}) { + if (auto bnb_result{SelectCoinsBnB(groups.positive_group, nTargetValue, coin_selection_params.m_cost_of_change, max_inputs_weight)}) { results.push_back(*bnb_result); } else append_error(bnb_result); |