diff --git a/src/komodo.h b/src/komodo.h index 0036299e2..5956ae9f0 100644 --- a/src/komodo.h +++ b/src/komodo.h @@ -99,6 +99,8 @@ int32_t komodo_parsestatefile(struct komodo_state *sp,FILE *fp,char *symbol,char if ( 0 && sp != 0 ) printf("%s load[%s.%d] NOTARIZED %d %s\n",ASSETCHAINS_SYMBOL,symbol,sp->NUM_NPOINTS,notarized_height,notarized_hash.ToString().c_str()); //if ( matched != 0 ) global independent states -> inside *sp + if ( komodo_verifynotarization(symbol,dest,height,notarized_height,notarized_hash,notarized_desttxid) != 0 ) + printf("error validating notarization\n"); komodo_eventadd_notarized(sp,symbol,ht,dest,notarized_hash,notarized_desttxid,notarized_height); } else if ( func == 'U' ) // deprecated diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index d0eed2afe..93fe2f05d 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -366,7 +366,12 @@ int32_t komodo_verifynotarizedscript(uint8_t *script,int32_t len,uint256 NOTARIZ int32_t komodo_verifynotarization(char *symbol,char *dest,int32_t height,int32_t NOTARIZED_HEIGHT,uint256 NOTARIZED_HASH,uint256 NOTARIZED_DESTTXID) { char params[256],*jsonstr,*hexstr; uint8_t script[8192]; int32_t n,len,retval = -1; cJSON *txjson,*vouts,*vout,*skey; - sprintf(params,"[\"%s\", 1]",NOTARIZED_DESTTXID.ToString().c_str()); + params[0] = '['; + params[1] = '"'; + for (i=0; i<32; i++) + sprintf(¶ms[i*2 + 2],"%02x",((uint8_t *)&NOTARIZED_DESTTXID)[i]); + strcat(params,"\", 1]"); + //sprintf(params,"[\"%s\", 1]",NOTARIZED_DESTTXID.ToString().c_str()); printf("src.%s dest.%s params.[%s] ht.%d notarized.%d\n",symbol,dest,params,height,NOTARIZED_HEIGHT); if ( strcmp(dest,"KMD") == 0 ) { @@ -379,7 +384,7 @@ int32_t komodo_verifynotarization(char *symbol,char *dest,int32_t height,int32_t { if ( BTCUSERPASS[0] != 0 ) { - printf("BTCUSERPASS.(%s)\n",BTCUSERPASS); + //printf("BTCUSERPASS.(%s)\n",BTCUSERPASS); jsonstr = komodo_issuemethod(BTCUSERPASS,(char *)"getrawtransaction",params,8332); } //else jsonstr = _dex_getrawtransaction(); diff --git a/src/komodo_utils.h b/src/komodo_utils.h index 0364dcbf6..81a116eda 100644 --- a/src/komodo_utils.h +++ b/src/komodo_utils.h @@ -1534,7 +1534,6 @@ void komodo_args() //printf("KOMODO.(%s) -> userpass.(%s)\n",fname,KMDUSERPASS); } else printf("couldnt open.(%s)\n",fname); } - printf("BTCUSERPASS.(%s)\n",BTCUSERPASS); } //fprintf(stderr,"%s chain params initialized\n",ASSETCHAINS_SYMBOL); }