This commit is contained in:
jl777
2016-10-23 12:25:09 -03:00
parent 9d68c1e789
commit 6a1edfa233

View File

@@ -603,6 +603,8 @@ int32_t komodo_voutupdate(int32_t notaryid,uint8_t *scriptbuf,int32_t scriptlen,
opretlen = (opretlen << 8) + scriptbuf[len++]; opretlen = (opretlen << 8) + scriptbuf[len++];
} }
if ( opretlen >= 32*2+4 ) if ( opretlen >= 32*2+4 )
{
if ( strcmp("KMD",(char *)&scriptbuf[len+32*2+4]) == 0 )
{ {
len += iguana_rwbignum(0,&scriptbuf[len],32,(uint8_t *)&kmdtxid); len += iguana_rwbignum(0,&scriptbuf[len],32,(uint8_t *)&kmdtxid);
len += iguana_rwnum(0,&scriptbuf[len],4,(uint8_t *)notarizedheightp); len += iguana_rwnum(0,&scriptbuf[len],4,(uint8_t *)notarizedheightp);
@@ -610,7 +612,7 @@ int32_t komodo_voutupdate(int32_t notaryid,uint8_t *scriptbuf,int32_t scriptlen,
//for (k=0; k<scriptlen; k++) //for (k=0; k<scriptlen; k++)
// printf("%02x",scriptbuf[k]); // printf("%02x",scriptbuf[k]);
//printf(" <- script ht.%d i.%d j.%d\n",height,i,j); //printf(" <- script ht.%d i.%d j.%d\n",height,i,j);
printf("ht.%d NOTARIZED.%d KMD.%s BTCTXID.%s\n",height,*notarizedheightp,kmdtxid.ToString().c_str(),btctxid.ToString().c_str()); printf("ht.%d NOTARIZED.%d KMD.%s BTCTXID.%s (%s)\n",height,*notarizedheightp,kmdtxid.ToString().c_str(),btctxid.ToString().c_str(),(char *)&scriptbuf[len+32*2+4]);
if ( *notarizedheightp > NOTARIZED_HEIGHT ) if ( *notarizedheightp > NOTARIZED_HEIGHT )
{ {
static uint256 zero; static uint256 zero;
@@ -620,6 +622,13 @@ int32_t komodo_voutupdate(int32_t notaryid,uint8_t *scriptbuf,int32_t scriptlen,
komodo_stateupdate(height,0,0,0,zero,0,0); komodo_stateupdate(height,0,0,0,zero,0,0);
} }
} }
else if ( i == 0 && scriptbuf[len] == 'P' )
{
double KMDBTC,BTCUSD,CNYUSD; uint32_t numprices,timestamp,pvals[128];
numprices = dpow_readprices(&scriptbuf[++len],&timestamp,&KMDBTC,&BTCUSD,&CNYUSD,pvals);
printf("Found OP_RETURN prices\n");
}
}
} }
return(notaryid); return(notaryid);
} }