@@ -2270,12 +2270,12 @@ bool CWallet::SelectCoins(const std::vector<COutput>& vAvailableCoins, const CAm
2270
2270
std::vector<COutput> vCoins (vAvailableCoins);
2271
2271
CAmount value_to_select = nTargetValue;
2272
2272
2273
+ // Default to bnb was not used. If we use it, we set it later
2274
+ bnb_used = false ;
2275
+
2273
2276
// coin control -> return all selected outputs (we want all selected to go into the transaction for sure)
2274
2277
if (coin_control.HasSelected () && !coin_control.fAllowOtherInputs )
2275
2278
{
2276
- // We didn't use BnB here, so set it to false.
2277
- bnb_used = false ;
2278
-
2279
2279
for (const COutput& out : vCoins)
2280
2280
{
2281
2281
if (!out.fSpendable )
@@ -2300,14 +2300,12 @@ bool CWallet::SelectCoins(const std::vector<COutput>& vAvailableCoins, const CAm
2300
2300
const CWalletTx& wtx = it->second ;
2301
2301
// Clearly invalid input, fail
2302
2302
if (wtx.tx ->vout .size () <= outpoint.n ) {
2303
- bnb_used = false ;
2304
2303
return false ;
2305
2304
}
2306
2305
// Just to calculate the marginal byte size
2307
2306
CInputCoin coin (wtx.tx , outpoint.n , wtx.GetSpendSize (outpoint.n , false ));
2308
2307
nValueFromPresetInputs += coin.txout .nValue ;
2309
2308
if (coin.m_input_bytes <= 0 ) {
2310
- bnb_used = false ;
2311
2309
return false ; // Not solvable, can't estimate size for fee
2312
2310
}
2313
2311
coin.effective_value = coin.txout .nValue - coin_selection_params.effective_fee .GetFee (coin.m_input_bytes );
@@ -2318,7 +2316,6 @@ bool CWallet::SelectCoins(const std::vector<COutput>& vAvailableCoins, const CAm
2318
2316
}
2319
2317
setPresetCoins.insert (coin);
2320
2318
} else {
2321
- bnb_used = false ;
2322
2319
return false ; // TODO: Allow non-wallet inputs
2323
2320
}
2324
2321
}
@@ -2678,7 +2675,7 @@ bool CWallet::CreateTransaction(interfaces::Chain::Lock& locked_chain, const std
2678
2675
}
2679
2676
2680
2677
// Choose coins to use
2681
- bool bnb_used;
2678
+ bool bnb_used = false ;
2682
2679
if (pick_new_inputs) {
2683
2680
nValueIn = 0 ;
2684
2681
setCoins.clear ();
0 commit comments