Check mygettxout

This commit is contained in:
jl777
2018-08-02 00:20:52 -11:00
parent 63605f0e4e
commit 654c77c8a3
2 changed files with 17 additions and 52 deletions

View File

@@ -1606,11 +1606,11 @@ bool GetAddressUnspent(uint160 addressHash, int type,
uint64_t myGettxout(uint256 hash,int32_t n)
{
CCoins coins;
LOCK2(cs_main,mempool.cs);
//LOCK2(cs_main,mempool.cs);
CCoinsViewMemPool view(pcoinsTip, mempool);
if (!view.GetCoins(hash, coins))
return(0);
if ( n<0 || (unsigned int)n>=coins.vout.size() || coins.vout[n].IsNull() )
if ( n < 0 || (unsigned int)n >= coins.vout.size() || coins.vout[n].IsNull() )
return(0);
else return(coins.vout[n].nValue);
}