diff --git a/iguana/SuperNET_category.c b/iguana/SuperNET_category.c index 5552d2795..6c7e4935a 100755 --- a/iguana/SuperNET_category.c +++ b/iguana/SuperNET_category.c @@ -204,14 +204,23 @@ char *SuperNET_categorymulticast(struct supernet_info *myinfo,int32_t surveyflag char *bitcoin_hexmsg(struct supernet_info *myinfo,struct category_info *cat,void *ptr,int32_t len,char *remoteaddr) { - char buf[IGUANA_MAXSCRIPTSIZE],*method="",*agent="",*retstr = 0; cJSON *json; - decode_hex((uint8_t *)buf,len,ptr); - if ( (json= cJSON_Parse(buf)) != 0 ) + char *method="",*agent="",*retstr = 0; cJSON *json,*valsobj; struct iguana_info *coin; + if ( (json= cJSON_Parse(ptr)) != 0 ) { agent = jstr(json,"agent"); method = jstr(json,"method"); + if ( (valsobj= jobj(json,"vals")) != 0 ) + { + if ( jstr(valsobj,"coin") != 0 && (coin= iguana_coinfind(jstr(valsobj,"coin"))) != 0 ) + { + if ( (coin->RELAYNODE != 0 || coin->VALIDATENODE != 0) && strcmp(agent,"iguana") == 0 && strcmp(method,"rawtx") == 0 ) + { + return(iguana_rawtx(myinfo,coin,json,remoteaddr,jstr(json,"changeaddr"),jobj(json,"addresses"),valsobj,jstr(json,"spendscriptstr"))); + } + } + } } - printf("bitcoin_hexmsg.(%s) from %s (%s/%s)\n",buf,remoteaddr,agent,method); + printf("bitcoin_hexmsg.(%s) from %s (%s/%s)\n",ptr,remoteaddr,agent,method); return(retstr); } diff --git a/iguana/SuperNET_hexmsg.c b/iguana/SuperNET_hexmsg.c index b03701a9c..a5b7c8850 100755 --- a/iguana/SuperNET_hexmsg.c +++ b/iguana/SuperNET_hexmsg.c @@ -85,6 +85,7 @@ void SuperNET_hexmsgprocess(struct supernet_info *myinfo,cJSON *retjson,cJSON *j if ( len > sizeof(_buf) ) buf = malloc(len); decode_hex(buf,len,hexmsg); + //printf("hex.(%s) -> (%s)\n",hexmsg,buf); categoryhash = jbits256(json,"categoryhash"); subhash = jbits256(json,"categoryhash"); if ( bits256_nonz(subhash) == 0 ) diff --git a/iguana/iguana_payments.c b/iguana/iguana_payments.c index 923cd005f..2a36431c8 100755 --- a/iguana/iguana_payments.c +++ b/iguana/iguana_payments.c @@ -548,7 +548,7 @@ STRING_ARRAY_OBJ_STRING(iguana,rawtx,changeaddr,addresses,vals,spendscriptstr) locktime = juint(vals,"locktime"); satoshis = j64bits(vals,"amount"); txfee = j64bits(vals,"txfee"); - if ( (rawtxtag= juint(vals,"rawtxtag")) != 0 ) + if ( (rawtxtag= juint(vals,"rawtxtag")) == 0 ) OS_randombytes((uint8_t *)&rawtxtag,sizeof(rawtxtag)); if ( (rawtx= iguana_createrawtx(myinfo,rawtxtag,symbol,&vins,locktime,satoshis,spendscriptstr,changeaddr,txfee,minconf,addresses)) != 0 ) {