aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/test
diff options
context:
space:
mode:
authorMurch <alszacrel@web.de>2015-12-07 00:15:36 +0100
committerMurch <alszacrel@web.de>2015-12-07 20:08:37 +0100
commitfc0f52d78085b6ef97d6821fc7592326c2d9b495 (patch)
treea2de0198446bee8439bfdba90cb74efd0256817c /src/wallet/test
parentaf9510e0374443b093d633a91c4f1f8bf5071292 (diff)
Added a test for the pruning of extraneous inputs after ApproximateBestSet
Diffstat (limited to 'src/wallet/test')
-rw-r--r--src/wallet/test/wallet_tests.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/wallet/test/wallet_tests.cpp b/src/wallet/test/wallet_tests.cpp
index 8b9292bd14..5e8ccd90ab 100644
--- a/src/wallet/test/wallet_tests.cpp
+++ b/src/wallet/test/wallet_tests.cpp
@@ -328,4 +328,22 @@ BOOST_AUTO_TEST_CASE(coin_selection_tests)
empty_wallet();
}
+BOOST_AUTO_TEST_CASE(pruning_in_ApproximateBestSet)
+{
+ CoinSet setCoinsRet;
+ CAmount nValueRet;
+
+ LOCK(wallet.cs_wallet);
+
+ empty_wallet();
+ for (int i = 0; i < 12; i++)
+ {
+ add_coin(10*CENT);
+ }
+ add_coin(100*CENT);
+ add_coin(100*CENT);
+ BOOST_CHECK(wallet.SelectCoinsMinConf(221*CENT, 1, 6, vCoins, setCoinsRet, nValueRet));
+ BOOST_CHECK_EQUAL(nValueRet, 230*CENT);
+}
+
BOOST_AUTO_TEST_SUITE_END()