This commit is contained in:
jl777
2017-01-16 14:53:36 +02:00
parent 81e91b43c1
commit ed93764557
2 changed files with 5 additions and 2 deletions

View File

@@ -371,7 +371,10 @@ int32_t komodo_verifynotarization(char *symbol,char *dest,int32_t height,int32_t
sprintf(&params[i*2 + 2],"%02x",((uint8_t *)&NOTARIZED_DESTTXID)[31-i]); sprintf(&params[i*2 + 2],"%02x",((uint8_t *)&NOTARIZED_DESTTXID)[31-i]);
strcat(params,"\", 1]");*/ strcat(params,"\", 1]");*/
sprintf(params,"[\"%s\", 1]",NOTARIZED_DESTTXID.ToString().c_str()); sprintf(params,"[\"%s\", 1]",NOTARIZED_DESTTXID.ToString().c_str());
if ( strcmp(symbol,ASSETCHAINS_SYMBOL[0]==0?(char *)"KMD":ASSETCHAINS_SYMBOL) != 0 )
return(0);
printf("[%s] src.%s dest.%s params.[%s] ht.%d notarized.%d\n",ASSETCHAINS_SYMBOL,symbol,dest,params,height,NOTARIZED_HEIGHT); printf("[%s] src.%s dest.%s params.[%s] ht.%d notarized.%d\n",ASSETCHAINS_SYMBOL,symbol,dest,params,height,NOTARIZED_HEIGHT);
if ( strcmp(dest,"KMD") == 0 ) if ( strcmp(dest,"KMD") == 0 )
{ {
if ( KMDUSERPASS[0] != 0 ) if ( KMDUSERPASS[0] != 0 )

View File

@@ -39,7 +39,7 @@ struct komodo_event *komodo_eventadd(struct komodo_state *sp,int32_t height,char
void komodo_eventadd_notarized(struct komodo_state *sp,char *symbol,int32_t height,char *dest,uint256 notarized_hash,uint256 notarized_desttxid,int32_t notarizedheight) void komodo_eventadd_notarized(struct komodo_state *sp,char *symbol,int32_t height,char *dest,uint256 notarized_hash,uint256 notarized_desttxid,int32_t notarizedheight)
{ {
struct komodo_event_notarized N; struct komodo_event_notarized N;
if ( komodo_verifynotarization(ASSETCHAINS_SYMBOL[0]==0?(char *)"KMD":ASSETCHAINS_SYMBOL,(char *)(ASSETCHAINS_SYMBOL[0] == 0 ? "BTC" : "KMD"),height,notarizedheight,notarized_hash,notarized_desttxid) != 0 ) if ( komodo_verifynotarization(symbol,dest,height,notarizedheight,notarized_hash,notarized_desttxid) != 0 )
printf("%s error validating notarization\n",ASSETCHAINS_SYMBOL); printf("%s error validating notarization\n",ASSETCHAINS_SYMBOL);
else else
{ {
@@ -48,7 +48,7 @@ void komodo_eventadd_notarized(struct komodo_state *sp,char *symbol,int32_t heig
N.desttxid = notarized_desttxid; N.desttxid = notarized_desttxid;
N.notarizedheight = notarizedheight; N.notarizedheight = notarizedheight;
strcpy(N.dest,dest); strcpy(N.dest,dest);
komodo_eventadd(sp,height,ASSETCHAINS_SYMBOL[0]==0?(char *)"KMD":ASSETCHAINS_SYMBOL,KOMODO_EVENT_NOTARIZED,(uint8_t *)&N,sizeof(N)); komodo_eventadd(sp,height,symbol,KOMODO_EVENT_NOTARIZED,(uint8_t *)&N,sizeof(N));
if ( sp != 0 ) if ( sp != 0 )
komodo_notarized_update(sp,height,notarizedheight,notarized_hash,notarized_desttxid); komodo_notarized_update(sp,height,notarizedheight,notarized_hash,notarized_desttxid);
} }