@@ -30,6 +30,11 @@ static std::vector<COutput> vCoins;
30
30
static const CWallet testWallet (" dummy" , CWalletDBWrapper::CreateDummy());
31
31
static CAmount balance = 0 ;
32
32
33
+ CoinEligibilityFilter filter_standard (1 , 6 , 0 );
34
+ CoinEligibilityFilter filter_confirmed (1 , 1 , 0 );
35
+ CoinEligibilityFilter filter_standard_extra (6 , 6 , 0 );
36
+ CoinSelectionParams coin_selection_params (false , 0 , 0 , CFeeRate(0 ), 0);
37
+
33
38
static void add_coin (const CAmount& nValue, int nInput, std::vector<CInputCoin>& set)
34
39
{
35
40
CMutableTransaction tx;
@@ -207,12 +212,17 @@ BOOST_AUTO_TEST_CASE(bnb_search_test)
207
212
for (int i = 0 ; i < 100 ; ++i) {
208
213
BOOST_CHECK (!SelectCoinsBnB (utxo_pool, 1 * CENT, 2 * CENT, selection, value_ret, not_input_fees));
209
214
}
210
- }
211
215
212
- CoinEligibilityFilter filter_standard (1 , 6 , 0 );
213
- CoinEligibilityFilter filter_confirmed (1 , 1 , 0 );
214
- CoinEligibilityFilter filter_standard_extra (6 , 6 , 0 );
215
- CoinSelectionParams coin_selection_params (false , 0 , 0 , CFeeRate(0 ), 0);
216
+ // Make sure that effective value is working in SelectCoinsMinConf when BnB is used
217
+ CoinSelectionParams coin_selection_params_bnb (true , 0 , 0 , CFeeRate (3000 ), 0 );
218
+ CoinSet setCoinsRet;
219
+ CAmount nValueRet;
220
+ bool bnb_used;
221
+ empty_wallet ();
222
+ add_coin (1 );
223
+ 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
224
+ BOOST_CHECK (!testWallet.SelectCoinsMinConf ( 1 * CENT, filter_standard, vCoins, setCoinsRet, nValueRet, coin_selection_params_bnb, bnb_used));
225
+ }
216
226
217
227
BOOST_AUTO_TEST_CASE (knapsack_solver_test)
218
228
{
0 commit comments