Skip to content

Commit fafd093

Browse files
author
MarcoFalke
committed
[wallet] Adjust pruning test
1 parent 0800092 commit fafd093

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/wallet/test/wallet_tests.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -336,14 +336,16 @@ BOOST_AUTO_TEST_CASE(pruning_in_ApproximateBestSet)
336336
LOCK(wallet.cs_wallet);
337337

338338
empty_wallet();
339-
for (int i = 0; i < 12; i++)
340-
{
341-
add_coin(10*CENT);
342-
}
343-
add_coin(100*CENT);
344-
add_coin(100*CENT);
345-
BOOST_CHECK(wallet.SelectCoinsMinConf(221*CENT, 1, 6, vCoins, setCoinsRet, nValueRet));
346-
BOOST_CHECK_EQUAL(nValueRet, 230*CENT);
339+
for (int i = 0; i < 100; i++)
340+
add_coin(10 * CENT);
341+
for (int i = 0; i < 100; i++)
342+
add_coin(1000 * CENT);
343+
344+
BOOST_CHECK(wallet.SelectCoinsMinConf(100001 * CENT, 1, 6, vCoins, setCoinsRet, nValueRet));
345+
// We need all 100 larger coins and exactly one small coin.
346+
// Superfluous small coins must be pruned:
347+
BOOST_CHECK_EQUAL(nValueRet, 100010 * CENT);
348+
BOOST_CHECK_EQUAL(setCoinsRet.size(), 101);
347349
}
348350

349351
BOOST_AUTO_TEST_SUITE_END()

0 commit comments

Comments
 (0)