test
This commit is contained in:
@@ -346,7 +346,7 @@ char *komodo_issuemethod(char *userpass,char *method,char *params,uint16_t port)
|
||||
return(retstr2);
|
||||
}
|
||||
|
||||
int32_t komodo_verifynotarizedscript(uint8_t *script,int32_t len,uint256 NOTARIZED_HASH)
|
||||
int32_t komodo_verifynotarizedscript(int32_t height,uint8_t *script,int32_t len,uint256 NOTARIZED_HASH)
|
||||
{
|
||||
int32_t i; uint256 hash; char params[256];
|
||||
for (i=0; i<32; i++)
|
||||
@@ -358,7 +358,7 @@ int32_t komodo_verifynotarizedscript(uint8_t *script,int32_t len,uint256 NOTARIZ
|
||||
printf(" notarized, ");
|
||||
for (i=0; i<32; i++)
|
||||
printf("%02x",((uint8_t *)&hash)[i]);
|
||||
printf(" opreturn from [%s]\n",ASSETCHAINS_SYMBOL);
|
||||
printf(" opreturn from [%s] ht.%d\n",ASSETCHAINS_SYMBOL,height);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -371,7 +371,7 @@ int32_t komodo_verifynotarization(char *symbol,char *dest,int32_t height,int32_t
|
||||
sprintf(¶ms[i*2 + 2],"%02x",((uint8_t *)&NOTARIZED_DESTTXID)[31-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 ( KMDUSERPASS[0] != 0 )
|
||||
@@ -401,7 +401,7 @@ int32_t komodo_verifynotarization(char *symbol,char *dest,int32_t height,int32_t
|
||||
if ( (txjson= jobj(json,(char *)"result")) != 0 && (vouts= jarray(&n,txjson,(char *)"vout")) > 0 )
|
||||
{
|
||||
vout = jitem(vouts,n-1);
|
||||
//printf("vout.(%s)\n",jprint(vout,0));
|
||||
printf("vout.(%s)\n",jprint(vout,0));
|
||||
if ( (skey= jobj(vout,(char *)"scriptPubKey")) != 0 )
|
||||
{
|
||||
if ( (hexstr= jstr(skey,(char *)"hex")) != 0 )
|
||||
@@ -409,7 +409,7 @@ int32_t komodo_verifynotarization(char *symbol,char *dest,int32_t height,int32_t
|
||||
//printf("HEX.(%s)\n",hexstr);
|
||||
len = strlen(hexstr) >> 1;
|
||||
decode_hex(script,len,hexstr);
|
||||
retval = komodo_verifynotarizedscript(script,len,NOTARIZED_HASH);
|
||||
retval = komodo_verifynotarizedscript(height,script,len,NOTARIZED_HASH);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ void komodo_eventadd_notarized(struct komodo_state *sp,char *symbol,int32_t heig
|
||||
{
|
||||
struct komodo_event_notarized N;
|
||||
if ( komodo_verifynotarization(symbol,dest,height,notarizedheight,notarized_hash,notarized_desttxid) != 0 )
|
||||
printf("error validating notarization\n");
|
||||
printf("%s error validating notarization\n",ASSETCHAINS_SYMBOL);
|
||||
else
|
||||
{
|
||||
memset(&N,0,sizeof(N));
|
||||
|
||||
Reference in New Issue
Block a user