diff options
| author | Pieter Wuille <[email protected]> | 2018-05-01 12:05:55 -0700 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2018-05-03 11:01:57 -0700 |
| commit | 6d714c3419b368671bd071a8992950c3dc00e613 (patch) | |
| tree | a61afc591ce7b0eecfbb633f025e2ab84487b29b /src | |
| parent | Merge #13136: [tests] Fix flake8 warnings in several wallet functional tests (diff) | |
| download | discoin-6d714c3419b368671bd071a8992950c3dc00e613.tar.xz discoin-6d714c3419b368671bd071a8992950c3dc00e613.zip | |
Make coincontrol use IsSolvable to determine solvability
Diffstat (limited to 'src')
| -rw-r--r-- | src/wallet/coincontrol.h | 2 | ||||
| -rw-r--r-- | src/wallet/wallet.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/wallet/coincontrol.h b/src/wallet/coincontrol.h index 2f08162ee..98b429850 100644 --- a/src/wallet/coincontrol.h +++ b/src/wallet/coincontrol.h @@ -22,7 +22,7 @@ public: boost::optional<OutputType> m_change_type; //! If false, allows unselected inputs, but requires all selected inputs be used bool fAllowOtherInputs; - //! Includes watch only addresses which match the ISMINE_WATCH_SOLVABLE criteria + //! Includes watch only addresses which are solvable bool fAllowWatchOnly; //! Override automatic min/max checks on fee, m_feerate must be set if true bool fOverrideFeeRate; diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 6e0f49f13..ab351871d 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2363,10 +2363,10 @@ void CWallet::AvailableCoins(std::vector<COutput> &vCoins, bool fOnlySafe, const continue; } - bool fSpendableIn = ((mine & ISMINE_SPENDABLE) != ISMINE_NO) || (coinControl && coinControl->fAllowWatchOnly && (mine & ISMINE_WATCH_SOLVABLE) != ISMINE_NO); - bool fSolvableIn = (mine & (ISMINE_SPENDABLE | ISMINE_WATCH_SOLVABLE)) != ISMINE_NO; + bool solvable = IsSolvable(*this, pcoin->tx->vout[i].scriptPubKey); + bool spendable = ((mine & ISMINE_SPENDABLE) != ISMINE_NO) || (((mine & ISMINE_WATCH_ONLY) != ISMINE_NO) && (coinControl && coinControl->fAllowWatchOnly && solvable)); - vCoins.push_back(COutput(pcoin, i, nDepth, fSpendableIn, fSolvableIn, safeTx)); + vCoins.push_back(COutput(pcoin, i, nDepth, spendable, solvable, safeTx)); // Checks the sum amount of all UTXO's. if (nMinimumSumAmount != MAX_MONEY) { |