test
This commit is contained in:
12
src/komodo.h
12
src/komodo.h
@@ -232,9 +232,9 @@ int32_t komodo_voutupdate(int32_t notaryid,uint8_t *scriptbuf,int32_t scriptlen,
|
||||
len += iguana_rwbignum(0,&scriptbuf[len],32,(uint8_t *)&kmdtxid);
|
||||
len += iguana_rwnum(0,&scriptbuf[len],4,(uint8_t *)notarizedheightp);
|
||||
len += iguana_rwbignum(0,&scriptbuf[len],32,(uint8_t *)&desttxid);
|
||||
//for (k=0; k<scriptlen; k++)
|
||||
// printf("%02x",scriptbuf[k]);
|
||||
//printf(" <- script ht.%d i.%d j.%d\n",height,i,j);
|
||||
for (k=0; k<scriptlen; k++)
|
||||
printf("%02x",scriptbuf[k]);
|
||||
printf(" <- script ht.%d i.%d j.%d\n",height,i,j);
|
||||
if ( *notarizedheightp > NOTARIZED_HEIGHT && *notarizedheightp < height )
|
||||
{
|
||||
printf("ht.%d NOTARIZED.%d KMD.%s BTCTXID.%s (%s)\n",height,*notarizedheightp,kmdtxid.ToString().c_str(),desttxid.ToString().c_str(),(char *)&scriptbuf[len]);
|
||||
@@ -250,7 +250,7 @@ int32_t komodo_voutupdate(int32_t notaryid,uint8_t *scriptbuf,int32_t scriptlen,
|
||||
double KMDBTC,BTCUSD,CNYUSD; uint32_t numpvals,timestamp,pvals[128];
|
||||
numpvals = dpow_readprices(&scriptbuf[++len],×tamp,&KMDBTC,&BTCUSD,&CNYUSD,pvals);
|
||||
komodo_stateupdate(height,0,0,0,zero,0,0,pvals,numpvals);
|
||||
//printf("vout OP_RETURN.%d prices numpvals.%d opretlen.%d\n",height,numpvals,opretlen);
|
||||
printf("vout OP_RETURN.%d prices numpvals.%d opretlen.%d\n",height,numpvals,opretlen);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -282,7 +282,7 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block)
|
||||
len = block.vtx[i].vout[j].scriptPubKey.size();
|
||||
if ( len <= sizeof(scriptbuf) )
|
||||
{
|
||||
memcpy(scriptbuf,&block.vtx[i].vout[j].scriptPubKey,len);
|
||||
memcpy(scriptbuf,block.vtx[i].vout[j].scriptPubKey.data(),len);
|
||||
notaryid = komodo_voutupdate(notaryid,scriptbuf,len,height,txhash,i,j,&voutmask,&specialtx,¬arizedheight);
|
||||
if ( 0 && i > 0 )
|
||||
{
|
||||
@@ -318,7 +318,7 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block)
|
||||
len = block.vtx[i].vout[j].scriptPubKey.size();
|
||||
if ( len <= sizeof(scriptbuf) )
|
||||
{
|
||||
memcpy(scriptbuf,&block.vtx[i].vout[j].scriptPubKey,len);
|
||||
memcpy(scriptbuf,block.vtx[i].vout[j].scriptPubKey.data(),len);
|
||||
if ( len == 35 && scriptbuf[0] == 33 && scriptbuf[34] == 0xac )
|
||||
{
|
||||
memcpy(pubkeys[numvalid++],scriptbuf+1,33);
|
||||
|
||||
@@ -130,7 +130,7 @@ void komodo_disconnect(CBlockIndex *pindex,CBlock& block)
|
||||
|
||||
int32_t komodo_block2height(CBlock *block)
|
||||
{
|
||||
int32_t i,n,height = 0; uint8_t *ptr = (uint8_t *)&block->vtx[0].vin[0].scriptSig;
|
||||
int32_t i,n,height = 0; uint8_t *ptr = (uint8_t *)block->vtx[0].vin[0].scriptSig.data();
|
||||
komodo_init();
|
||||
if ( block->vtx[0].vin[0].scriptSig.size() > 5 )
|
||||
{
|
||||
@@ -150,7 +150,7 @@ int32_t komodo_block2height(CBlock *block)
|
||||
|
||||
void komodo_block2pubkey33(uint8_t *pubkey33,CBlock& block)
|
||||
{
|
||||
uint8_t *ptr = (uint8_t *)&block.vtx[0].vout[0].scriptPubKey;
|
||||
uint8_t *ptr = (uint8_t *)block.vtx[0].vout[0].scriptPubKey.data();
|
||||
komodo_init();
|
||||
memcpy(pubkey33,ptr+1,33);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user