This commit is contained in:
jl777
2017-01-16 13:34:40 +02:00
parent de28264f07
commit eee286628f
3 changed files with 9 additions and 3 deletions

View File

@@ -99,6 +99,8 @@ int32_t komodo_parsestatefile(struct komodo_state *sp,FILE *fp,char *symbol,char
if ( 0 && sp != 0 ) 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()); 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 ( 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); komodo_eventadd_notarized(sp,symbol,ht,dest,notarized_hash,notarized_desttxid,notarized_height);
} }
else if ( func == 'U' ) // deprecated else if ( func == 'U' ) // deprecated

View File

@@ -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) 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; 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(&params[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); printf("src.%s dest.%s params.[%s] ht.%d notarized.%d\n",symbol,dest,params,height,NOTARIZED_HEIGHT);
if ( strcmp(dest,"KMD") == 0 ) 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 ) if ( BTCUSERPASS[0] != 0 )
{ {
printf("BTCUSERPASS.(%s)\n",BTCUSERPASS); //printf("BTCUSERPASS.(%s)\n",BTCUSERPASS);
jsonstr = komodo_issuemethod(BTCUSERPASS,(char *)"getrawtransaction",params,8332); jsonstr = komodo_issuemethod(BTCUSERPASS,(char *)"getrawtransaction",params,8332);
} }
//else jsonstr = _dex_getrawtransaction(); //else jsonstr = _dex_getrawtransaction();

View File

@@ -1534,7 +1534,6 @@ void komodo_args()
//printf("KOMODO.(%s) -> userpass.(%s)\n",fname,KMDUSERPASS); //printf("KOMODO.(%s) -> userpass.(%s)\n",fname,KMDUSERPASS);
} else printf("couldnt open.(%s)\n",fname); } else printf("couldnt open.(%s)\n",fname);
} }
printf("BTCUSERPASS.(%s)\n",BTCUSERPASS);
} }
//fprintf(stderr,"%s chain params initialized\n",ASSETCHAINS_SYMBOL); //fprintf(stderr,"%s chain params initialized\n",ASSETCHAINS_SYMBOL);
} }