This commit is contained in:
jl777
2016-10-18 19:40:45 -03:00
parent 74a3757792
commit c73c41db3c

View File

@@ -462,25 +462,13 @@ Value gettxout(const Array& params, bool fHelp)
char *komodo_getspendscript(uint256 hash,int32_t n) char *komodo_getspendscript(uint256 hash,int32_t n)
{ {
CCoins coins; CBlockIndex *pindex; CTransaction tx; uint256 hashBlock;
LOCK(cs_main); if ( GetTransaction(hash,tx,Params().GetConsensus(),hashBlock,true) != 0 )
{ {
LOCK(mempool.cs); if ( n >= 0 && n < tx.vout.size() )
CCoinsViewMemPool view(pcoinsTip, mempool); return((char *)tx.vout[n].scriptPubKey.ToString().c_str());
if (!view.GetCoins(hash, coins)) } else printf("null GetTransaction\n");
{ return(0);
printf("null view.GetCoins\n");
return(0);
}
}
if ( n < 0 || (unsigned int)n >= coins.vout.size() )
{
printf("komodo_getspendscript illegal n.%d\n",n);
return(0);
}
BlockMap::iterator it = mapBlockIndex.find(pcoinsTip->GetBestBlock());
pindex = it->second;
return((char *)coins.vout[n].scriptPubKey.ToString().c_str());
} }
Value verifychain(const Array& params, bool fHelp) Value verifychain(const Array& params, bool fHelp)