Skip to content

Commit 6ef9982

Browse files
committed
Actually disable BnB when there are preset inputs
We don't want to use BnB when there are preset inputs because there is some weirdness with making that work with using the KnapsackSolver as the fallback. Currently we say that we haven't used bnb when there are preset inputs, but we don't actually disable BnB. This fixes that.
1 parent e057589 commit 6ef9982

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/wallet/wallet.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2493,7 +2493,7 @@ bool CWallet::SelectCoinsMinConf(const CAmount& nTargetValue, const CoinEligibil
24932493
}
24942494
}
24952495

2496-
bool CWallet::SelectCoins(const std::vector<COutput>& vAvailableCoins, const CAmount& nTargetValue, std::set<CInputCoin>& setCoinsRet, CAmount& nValueRet, const CCoinControl& coin_control, const CoinSelectionParams& coin_selection_params, bool& bnb_used) const
2496+
bool CWallet::SelectCoins(const std::vector<COutput>& vAvailableCoins, const CAmount& nTargetValue, std::set<CInputCoin>& setCoinsRet, CAmount& nValueRet, const CCoinControl& coin_control, CoinSelectionParams& coin_selection_params, bool& bnb_used) const
24972497
{
24982498
std::vector<COutput> vCoins(vAvailableCoins);
24992499

@@ -2523,6 +2523,7 @@ bool CWallet::SelectCoins(const std::vector<COutput>& vAvailableCoins, const CAm
25232523
{
25242524
// For now, don't use BnB if preset inputs are selected. TODO: Enable this later
25252525
bnb_used = false;
2526+
coin_selection_params.use_bnb = false;
25262527

25272528
std::map<uint256, CWalletTx>::const_iterator it = mapWallet.find(outpoint.hash);
25282529
if (it != mapWallet.end())

src/wallet/wallet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ class CWallet final : public CCryptoKeyStore, public CValidationInterface
674674
* if they are not ours
675675
*/
676676
bool SelectCoins(const std::vector<COutput>& vAvailableCoins, const CAmount& nTargetValue, std::set<CInputCoin>& setCoinsRet, CAmount& nValueRet,
677-
const CCoinControl& coin_control, const CoinSelectionParams& coin_selection_params, bool& bnb_used) const;
677+
const CCoinControl& coin_control, CoinSelectionParams& coin_selection_params, bool& bnb_used) const;
678678

679679
CWalletDB *pwalletdbEncryption;
680680

0 commit comments

Comments
 (0)