From bfa5b4f2171df3c9239516c855ca34e533e866d8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 26 Oct 2016 12:48:34 -0300 Subject: [PATCH] test --- src/komodo.h | 3 ++- src/komodo_gateway.h | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/komodo.h b/src/komodo.h index 1eda3e237..0a9071ae0 100644 --- a/src/komodo.h +++ b/src/komodo.h @@ -202,7 +202,7 @@ void komodo_stateupdate(int32_t height,uint8_t notarypubs[][33],uint8_t numnotar //#ifdef KOMODO_PAX else if ( pvals != 0 && numpvals > 0 ) { - int32_t nonz = 0; + int32_t i,nonz = 0; for (i=0; i<32; i++) if ( pvals[i] != 0 ) nonz++; @@ -354,6 +354,7 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block) #else memcpy(scriptbuf,(uint8_t *)&block.vtx[i].vout[j].scriptPubKey[0],len); #endif + // signedmask is needed here! notaryid = komodo_voutupdate(notaryid,scriptbuf,len,height,txhash,i,j,&voutmask,&specialtx,¬arizedheight,(uint64_t)block.vtx[i].vout[j].nValue); if ( 0 && i > 0 ) { diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 6f7e2e0e1..3e9456ce2 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -43,14 +43,14 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 return(typestr); } -void komodo_gateway_voutupdate(char *symbol,int32_t height,int32_t txi,int32_t vout,int32_t numvouts,uint64_t value,uint8_t *script,int32_t len) +void komodo_gateway_voutupdate(char *symbol,int32_t isspecial,int32_t height,int32_t txi,int32_t vout,int32_t numvouts,uint64_t value,uint8_t *script,int32_t len) { int32_t i,opretlen,offset = 0; uint256 zero; const char *typestr; typestr = "unknown"; if ( script[offset++] == 0x6a ) { offset += komodo_scriptitemlen(&opretlen,&script[offset]); - if ( len >= offset+32*2+4 && strcmp((char *)&script[offset+32*2+4],"KMD") == 0 ) + if ( isspecial != 0 && len >= offset+32*2+4 && strcmp((char *)&script[offset+32*2+4],"KMD") == 0 ) typestr = "notarized"; else if ( script[offset] == 'P' ) { @@ -58,7 +58,7 @@ void komodo_gateway_voutupdate(char *symbol,int32_t height,int32_t txi,int32_t v komodo_paxpricefeed(height,&script[++offset],opretlen); printf("height.%d pricefeed len.%d\n",height,opretlen); } - else + else if ( isspecial != 0 ) { komodo_stateupdate(0,0,0,0,zero,0,0,0,0,0,value,&script[offset],opretlen); for (i=0; i