coin selection: BnB, don't return selection if exceeds max allowed tx weight

This commit is contained in:
furszy
2022-12-18 20:16:19 -03:00
parent d3a1c098e4
commit 2d112584e3
6 changed files with 23 additions and 7 deletions

View File

@@ -5,6 +5,7 @@
#include <bench/bench.h>
#include <interfaces/chain.h>
#include <node/context.h>
#include <policy/policy.h>
#include <wallet/coinselection.h>
#include <wallet/spend.h>
#include <wallet/wallet.h>
@@ -115,7 +116,7 @@ static void BnBExhaustion(benchmark::Bench& bench)
bench.run([&] {
// Benchmark
CAmount target = make_hard_case(17, utxo_pool);
SelectCoinsBnB(utxo_pool, target, 0); // Should exhaust
SelectCoinsBnB(utxo_pool, target, 0, MAX_STANDARD_TX_WEIGHT); // Should exhaust
// Cleanup
utxo_pool.clear();