Add more checks for coinstake transactions

This commit is contained in:
lateminer
2018-10-25 19:55:30 +03:00
parent ea42219781
commit 9558397bb7

View File

@@ -76,7 +76,7 @@ void WalletTxToJSON(const CWalletTx& wtx, UniValue& entry)
{
int confirms = wtx.GetDepthInMainChain();
entry.push_back(Pair("confirmations", confirms));
if (wtx.IsCoinBase())
if (wtx.IsCoinBase() || wtx.IsCoinStake())
entry.push_back(Pair("generated", true));
if (confirms > 0)
{
@@ -601,7 +601,7 @@ UniValue getreceivedbyaddress(const UniValue& params, bool fHelp)
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
{
const CWalletTx& wtx = (*it).second;
if (wtx.IsCoinBase() || !CheckFinalTx(wtx))
if (wtx.IsCoinBase() || wtx.IsCoinStake() ||!CheckFinalTx(wtx))
continue;
for (const CTxOut &txout : wtx.vout)