diff --git a/src/wallet/test/coinselector_tests.cpp b/src/wallet/test/coinselector_tests.cpp --- a/src/wallet/test/coinselector_tests.cpp +++ b/src/wallet/test/coinselector_tests.cpp @@ -231,6 +231,22 @@ BOOST_CHECK(!SelectCoinsBnB(utxo_pool, 1 * CENT, 2 * CENT, selection, value_ret, not_input_fees)); } + + // Make sure that effective value is working in SelectCoinsMinConf when BnB + // is used + CoinSelectionParams coin_selection_params_bnb(true, 0, 0, + CFeeRate(3000 * SATOSHI), 0); + CoinSet setCoinsRet; + Amount nValueRet; + bool bnb_used; + empty_wallet(); + add_coin(m_wallet, SATOSHI); + // Make sure that it has a negative effective value. The next check should + // assert if this somehow got through. Otherwise it will fail + vCoins.at(0).nInputBytes = 40; + BOOST_CHECK(!m_wallet.SelectCoinsMinConf( + 1 * CENT, filter_standard, vCoins, setCoinsRet, nValueRet, + coin_selection_params_bnb, bnb_used)); } BOOST_AUTO_TEST_CASE(knapsack_solver_test) {