diff options
author | Andrew Chow <achow101-github@achow101.com> | 2019-10-25 18:45:58 -0400 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2019-11-20 12:12:01 -0500 |
commit | b007efdf1910db1d38671d6435d2f379bbf847d2 (patch) | |
tree | 838b89258d7275a9bc084eb9110ab8dbdb98de65 /src/wallet/test | |
parent | db15e71e79b24601853703bebd1c92f4b523fd5f (diff) | |
download | bitcoin-b007efdf1910db1d38671d6435d2f379bbf847d2.tar.xz |
Allow BnB when subtract fee from outputs
Diffstat (limited to 'src/wallet/test')
-rw-r--r-- | src/wallet/test/coinselector_tests.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/wallet/test/coinselector_tests.cpp b/src/wallet/test/coinselector_tests.cpp index bc61630363..4fa5c51491 100644 --- a/src/wallet/test/coinselector_tests.cpp +++ b/src/wallet/test/coinselector_tests.cpp @@ -260,6 +260,15 @@ BOOST_AUTO_TEST_CASE(bnb_search_test) vCoins.at(0).nInputBytes = 40; // Make sure that it has a negative effective value. The next check should assert if this somehow got through. Otherwise it will fail BOOST_CHECK(!testWallet.SelectCoinsMinConf( 1 * CENT, filter_standard, GroupCoins(vCoins), setCoinsRet, nValueRet, coin_selection_params_bnb, bnb_used)); + // Test fees subtracted from output: + empty_wallet(); + add_coin(1 * CENT); + vCoins.at(0).nInputBytes = 40; + BOOST_CHECK(!testWallet.SelectCoinsMinConf( 1 * CENT, filter_standard, GroupCoins(vCoins), setCoinsRet, nValueRet, coin_selection_params_bnb, bnb_used)); + coin_selection_params_bnb.m_subtract_fee_outputs = true; + BOOST_CHECK(testWallet.SelectCoinsMinConf( 1 * CENT, filter_standard, GroupCoins(vCoins), setCoinsRet, nValueRet, coin_selection_params_bnb, bnb_used)); + BOOST_CHECK_EQUAL(nValueRet, 1 * CENT); + // Make sure that can use BnB when there are preset inputs empty_wallet(); { |