wallet:COutput adding fIsCoinbase member.

This commit is contained in:
furszy 2020-10-31 23:20:27 -03:00
parent a1b7cd4b05
commit d8e154ebfb
No known key found for this signature in database
GPG Key ID: 5DD23CCC686AA623
2 changed files with 6 additions and 6 deletions

View File

@ -3237,7 +3237,8 @@ void CWallet::AvailableCoins(vector<COutput>& vCoins,
if (pcoin->IsCoinBase() && !fIncludeCoinBase)
continue;
if (pcoin->IsCoinBase() && pcoin->GetBlocksToMaturity() > 0)
bool isCoinbase = pcoin->IsCoinBase();
if (isCoinbase && pcoin->GetBlocksToMaturity() > 0)
continue;
int nDepth = pcoin->GetDepthInMainChain();
@ -3265,7 +3266,7 @@ void CWallet::AvailableCoins(vector<COutput>& vCoins,
if (!(IsSpent(wtxid, i)) && mine != ISMINE_NO &&
!IsLockedCoin((*it).first, i) && (pcoin->vout[i].nValue > 0 || fIncludeZeroValue) &&
(!coinControl || !coinControl->HasSelected() || coinControl->fAllowOtherInputs || coinControl->IsSelected((*it).first, i)))
vCoins.push_back(COutput(pcoin, i, nDepth, isSpendable));
vCoins.push_back(COutput(pcoin, i, nDepth, isSpendable, isCoinbase));
}
}
}

View File

@ -620,11 +620,10 @@ public:
int i;
int nDepth;
bool fSpendable;
bool fIsCoinbase;
COutput(const CWalletTx *txIn, int iIn, int nDepthIn, bool fSpendableIn)
{
tx = txIn; i = iIn; nDepth = nDepthIn; fSpendable = fSpendableIn;
}
COutput(const CWalletTx *txIn, int iIn, int nDepthIn, bool fSpendableIn, bool fIsCoinbaseIn = false) :
tx(txIn), i(iIn), nDepth(nDepthIn), fSpendable(fSpendableIn), fIsCoinbase(fIsCoinbaseIn){ }
std::string ToString() const;
};