Skip to content

Commit 398877e

Browse files
committed
[wallet] coin selection: remove bnb_used = false
1 parent 7e6cf10 commit 398877e

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/wallet/wallet.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2683,9 +2683,6 @@ bool CWallet::SelectCoins(const std::vector<COutput>& vAvailableCoins, const CAm
26832683
// coin control -> return all selected outputs (we want all selected to go into the transaction for sure)
26842684
if (coin_control.HasSelected() && !coin_control.fAllowOtherInputs)
26852685
{
2686-
// We didn't use BnB here, so set it to false.
2687-
bnb_used = false;
2688-
26892686
for (const COutput& out : vCoins)
26902687
{
26912688
if (!out.fSpendable)
@@ -2710,14 +2707,12 @@ bool CWallet::SelectCoins(const std::vector<COutput>& vAvailableCoins, const CAm
27102707
const CWalletTx& wtx = it->second;
27112708
// Clearly invalid input, fail
27122709
if (wtx.tx->vout.size() <= outpoint.n) {
2713-
bnb_used = false;
27142710
return false;
27152711
}
27162712
// Just to calculate the marginal byte size
27172713
CInputCoin coin(wtx.tx, outpoint.n, wtx.GetSpendSize(outpoint.n, false));
27182714
nValueFromPresetInputs += coin.txout.nValue;
27192715
if (coin.m_input_bytes <= 0) {
2720-
bnb_used = false;
27212716
return false; // Not solvable, can't estimate size for fee
27222717
}
27232718
coin.effective_value = coin.txout.nValue - coin_selection_params.effective_fee.GetFee(coin.m_input_bytes);
@@ -2728,7 +2723,6 @@ bool CWallet::SelectCoins(const std::vector<COutput>& vAvailableCoins, const CAm
27282723
}
27292724
setPresetCoins.insert(coin);
27302725
} else {
2731-
bnb_used = false;
27322726
return false; // TODO: Allow non-wallet inputs
27332727
}
27342728
}
@@ -3081,7 +3075,7 @@ bool CWallet::CreateTransaction(interfaces::Chain::Lock& locked_chain, const std
30813075
}
30823076

30833077
// Choose coins to use
3084-
bool bnb_used;
3078+
bool bnb_used = false;
30853079
if (pick_new_inputs) {
30863080
nValueIn = 0;
30873081
setCoins.clear();

0 commit comments

Comments
 (0)