This commit is contained in:
jl777
2016-10-18 19:19:24 -03:00
parent 745f5b12ff
commit 53b58ced34
2 changed files with 12 additions and 6 deletions

View File

@@ -57,12 +57,12 @@ int32_t iguana_rwbignum(int32_t rwflag,uint8_t *serialized,int32_t len,uint8_t *
if ( rwflag == 0 )
{
for (i=0; i<len; i++)
endianedp[i] = serialized[len - 1 - i];
endianedp[i] = serialized[i];
}
else
{
for (i=0; i<len; i++)
serialized[i] = endianedp[len - 1 - i];
serialized[i] = endianedp[i];
}
return(len);
}
@@ -224,7 +224,7 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block)
for (j=0; j<numvins; j++)
{
if ( (scriptstr= komodo_gettxout(block.vtx[i].vin[j].prevout.hash,block.vtx[i].vin[j].prevout.n)) != 0 )
printf("ht.%d i.%d j.%d (%s)\n",height,i,j,scriptstr);
printf("vini ht.%d i.%d j.%d (%s)\n",height,i,j,scriptstr);
}
numvouts = block.vtx[i].vout.size();
for (j=0; j<numvouts; j++)

View File

@@ -460,13 +460,19 @@ Value gettxout(const Array& params, bool fHelp)
return ret;
}
char *komodo_gettxout(uint256 hash,int32_t n)
char *komodo_getspendscript(uint256 hash,int32_t n)
{
CCoins coins; CBlockIndex *pindex;
if ( pcoinsTip->GetCoins(hash,coins) == 0 )
return(0);
if ( n < 0 || (unsigned int)n >= coins.vout.size() || coins.vout[n].IsNull() )
{
printf("null pcoinsTip->GetCoins\n");
return(0);
}
if ( n < 0 || (unsigned int)n >= coins.vout.size() )
{
printf("komodo_getspendscript illegal n.%d size.%d\n",n,coins.vout.size());
return(0);
}
BlockMap::iterator it = mapBlockIndex.find(pcoinsTip->GetBestBlock());
pindex = it->second;
return((char *)coins.vout[n].scriptPubKey.ToString().c_str());