Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/wallet/rpcwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3194,7 +3194,6 @@ UniValue listunspent(const JSONRPCRequest& request)
false, // include cold staking
ALL_COINS, // coin type
false, // only confirmed
false, // include zero value
false // use IX
);
for (const COutput& out : vecOutputs) {
Expand Down
36 changes: 21 additions & 15 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2128,7 +2128,6 @@ bool CWallet::AvailableCoins(std::vector<COutput>* pCoins, // --> populates
bool fIncludeColdStaking, // Default: false
AvailableCoinsType nCoinType, // Default: ALL_COINS
bool fOnlyConfirmed, // Default: true
bool fIncludeZeroValue, // Default: false
bool fUseIX // Default: false
) const
{
Expand All @@ -2153,24 +2152,32 @@ bool CWallet::AvailableCoins(std::vector<COutput>* pCoins, // --> populates
if (nCoinType == STAKEABLE_COINS && nDepth < Params().GetConsensus().nStakeMinDepth) continue;

for (unsigned int i = 0; i < pcoin->vout.size(); i++) {
bool found = false;
if (nCoinType == ONLY_10000) {
found = pcoin->vout[i].nValue == 10000 * COIN;
} else {
found = true;
}
if (!found) continue;

// Check for only 10k utxo
if (nCoinType == ONLY_10000 && pcoin->vout[i].nValue != 10000 * COIN) continue;

// Check for stakeable utxo
if (nCoinType == STAKEABLE_COINS && pcoin->vout[i].IsZerocoinMint()) continue;

// Check if the utxo was spent.
if (IsSpent(wtxid, i)) continue;

isminetype mine = IsMine(pcoin->vout[i]);
if ( (mine == ISMINE_NO) ||
(mine == ISMINE_WATCH_ONLY && coinControl && !coinControl->fAllowWatchOnly) ||
(IsLockedCoin((*it).first, i) && nCoinType != ONLY_10000) ||
(pcoin->vout[i].nValue <= 0 && !fIncludeZeroValue) ||
(fCoinsSelected && !coinControl->fAllowOtherInputs && !coinControl->IsSelected(COutPoint((*it).first, i)))
) continue;

// Check If not mine
if (mine == ISMINE_NO) continue;

// Check if watch only utxo are allowed
if (mine == ISMINE_WATCH_ONLY && coinControl && !coinControl->fAllowWatchOnly) continue;

// Skip locked utxo
if (IsLockedCoin((*it).first, i) && nCoinType != ONLY_10000) continue;

// Check if we should include zero value utxo
if (pcoin->vout[i].nValue <= 0) continue;

if (fCoinsSelected && !coinControl->fAllowOtherInputs && !coinControl->IsSelected(COutPoint((*it).first, i)))
continue;

// --Skip P2CS outputs
// skip cold coins
Expand Down Expand Up @@ -2561,7 +2568,6 @@ bool CWallet::CreateTransaction(const std::vector<CRecipient>& vecSend,
false, // fIncludeColdStaking
coin_type,
true, // fOnlyConfirmed
false, // fIncludeZeroValue
useIX);

nFeeRet = 0;
Expand Down
1 change: 0 additions & 1 deletion src/wallet/wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,6 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface
bool fIncludeColdStaking = false,
AvailableCoinsType nCoinType = ALL_COINS,
bool fOnlyConfirmed = true,
bool fIncludeZeroValue = false,
bool fUseIX = false
) const;
//! >> Available coins (spending)
Expand Down