aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2016-01-05 12:44:55 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2016-01-05 12:55:00 +0100
commit2078495d9c5fa684e6dc93a6fc77329b58e96826 (patch)
tree982ec5c8b0c577e7a2f2547018cc637b3df30481
parenta10a7920c3ace7cd14f9c3837ec78d049f5bc410 (diff)
parentfafd09375eb5133abf921132643384a1ac6fa444 (diff)
Merge pull request #7193
fafd093 [wallet] Adjust pruning test (MarcoFalke)
-rw-r--r--src/wallet/test/wallet_tests.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/wallet/test/wallet_tests.cpp b/src/wallet/test/wallet_tests.cpp
index 5e8ccd90ab..ee4f228a0a 100644
--- a/src/wallet/test/wallet_tests.cpp
+++ b/src/wallet/test/wallet_tests.cpp
@@ -336,14 +336,16 @@ BOOST_AUTO_TEST_CASE(pruning_in_ApproximateBestSet)
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);
+ for (int i = 0; i < 100; i++)
+ add_coin(10 * CENT);
+ for (int i = 0; i < 100; i++)
+ add_coin(1000 * CENT);
+
+ BOOST_CHECK(wallet.SelectCoinsMinConf(100001 * CENT, 1, 6, vCoins, setCoinsRet, nValueRet));
+ // We need all 100 larger coins and exactly one small coin.
+ // Superfluous small coins must be pruned:
+ BOOST_CHECK_EQUAL(nValueRet, 100010 * CENT);
+ BOOST_CHECK_EQUAL(setCoinsRet.size(), 101);
}
BOOST_AUTO_TEST_SUITE_END()