Skip to content

Commit 6d714c3

Browse files
committed
Make coincontrol use IsSolvable to determine solvability
1 parent baf6b4e commit 6d714c3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/wallet/coincontrol.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class CCoinControl
2222
boost::optional<OutputType> m_change_type;
2323
//! If false, allows unselected inputs, but requires all selected inputs be used
2424
bool fAllowOtherInputs;
25-
//! Includes watch only addresses which match the ISMINE_WATCH_SOLVABLE criteria
25+
//! Includes watch only addresses which are solvable
2626
bool fAllowWatchOnly;
2727
//! Override automatic min/max checks on fee, m_feerate must be set if true
2828
bool fOverrideFeeRate;

src/wallet/wallet.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2363,10 +2363,10 @@ void CWallet::AvailableCoins(std::vector<COutput> &vCoins, bool fOnlySafe, const
23632363
continue;
23642364
}
23652365

2366-
bool fSpendableIn = ((mine & ISMINE_SPENDABLE) != ISMINE_NO) || (coinControl && coinControl->fAllowWatchOnly && (mine & ISMINE_WATCH_SOLVABLE) != ISMINE_NO);
2367-
bool fSolvableIn = (mine & (ISMINE_SPENDABLE | ISMINE_WATCH_SOLVABLE)) != ISMINE_NO;
2366+
bool solvable = IsSolvable(*this, pcoin->tx->vout[i].scriptPubKey);
2367+
bool spendable = ((mine & ISMINE_SPENDABLE) != ISMINE_NO) || (((mine & ISMINE_WATCH_ONLY) != ISMINE_NO) && (coinControl && coinControl->fAllowWatchOnly && solvable));
23682368

2369-
vCoins.push_back(COutput(pcoin, i, nDepth, fSpendableIn, fSolvableIn, safeTx));
2369+
vCoins.push_back(COutput(pcoin, i, nDepth, spendable, solvable, safeTx));
23702370

23712371
// Checks the sum amount of all UTXO's.
23722372
if (nMinimumSumAmount != MAX_MONEY) {

0 commit comments

Comments
 (0)