From 6a1edfa2333c12a59d7cf1d98c1f4c7b37abcc11 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 23 Oct 2016 12:25:09 -0300 Subject: [PATCH] test --- src/komodo.h | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/src/komodo.h b/src/komodo.h index 1f7552950..84ab40abd 100644 --- a/src/komodo.h +++ b/src/komodo.h @@ -604,20 +604,29 @@ int32_t komodo_voutupdate(int32_t notaryid,uint8_t *scriptbuf,int32_t scriptlen, } if ( opretlen >= 32*2+4 ) { - 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 *)&btctxid); - //for (k=0; k NOTARIZED_HEIGHT ) + if ( strcmp("KMD",(char *)&scriptbuf[len+32*2+4]) == 0 ) { - static uint256 zero; - NOTARIZED_HEIGHT = *notarizedheightp; - NOTARIZED_HASH = kmdtxid; - NOTARIZED_BTCTXID = btctxid; - komodo_stateupdate(height,0,0,0,zero,0,0); + 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 *)&btctxid); + //for (k=0; k NOTARIZED_HEIGHT ) + { + static uint256 zero; + NOTARIZED_HEIGHT = *notarizedheightp; + NOTARIZED_HASH = kmdtxid; + NOTARIZED_BTCTXID = btctxid; + 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],×tamp,&KMDBTC,&BTCUSD,&CNYUSD,pvals); + printf("Found OP_RETURN prices\n"); } } }