This commit is contained in:
jl777
2016-10-18 19:30:22 -03:00
parent 38f6c6f0fd
commit 74a3757792

View File

@@ -464,12 +464,14 @@ char *komodo_getspendscript(uint256 hash,int32_t n)
{ {
CCoins coins; CBlockIndex *pindex; CCoins coins; CBlockIndex *pindex;
LOCK(cs_main); LOCK(cs_main);
LOCK(mempool.cs);
CCoinsViewMemPool view(pcoinsTip, mempool);
if (!view.GetCoins(hash, coins))
{ {
printf("null view.GetCoins\n"); LOCK(mempool.cs);
return(0); CCoinsViewMemPool view(pcoinsTip, mempool);
if (!view.GetCoins(hash, coins))
{
printf("null view.GetCoins\n");
return(0);
}
} }
if ( n < 0 || (unsigned int)n >= coins.vout.size() ) if ( n < 0 || (unsigned int)n >= coins.vout.size() )
{ {