|
@ -545,7 +545,7 @@ char *iguana_createrawtx(struct supernet_info *myinfo,uint32_t rawtxtag,char *sy |
|
|
|
|
|
|
|
|
STRING_ARRAY_OBJ_STRING(iguana,rawtx,changeaddr,addresses,vals,spendscriptstr) |
|
|
STRING_ARRAY_OBJ_STRING(iguana,rawtx,changeaddr,addresses,vals,spendscriptstr) |
|
|
{ |
|
|
{ |
|
|
cJSON *vins=0,*retjson,*hexjson,*valsobj; char buf[2*IGUANA_MAXSCRIPTSIZE+8192],*str,*rawtx=0,*symbol=0; int64_t txfee,satoshis; uint32_t i,j,locktime,minconf,rawtxtag; struct iguana_peer *addr; |
|
|
cJSON *vins=0,*retjson,*hexjson,*valsobj; char buf[2*IGUANA_MAXSCRIPTSIZE+8192],*str,*rawtx=0,*symbol=0; int64_t txfee,satoshis; uint32_t locktime,minconf,rawtxtag; |
|
|
//printf("RAWTX changeaddr.%s (%s) remote.(%s)\n",changeaddr==0?"":changeaddr,jprint(json,0),remoteaddr);
|
|
|
//printf("RAWTX changeaddr.%s (%s) remote.(%s)\n",changeaddr==0?"":changeaddr,jprint(json,0),remoteaddr);
|
|
|
retjson = cJSON_CreateObject(); |
|
|
retjson = cJSON_CreateObject(); |
|
|
if ( spendscriptstr != 0 && spendscriptstr[0] != 0 && (symbol= jstr(vals,"coin")) != 0 ) |
|
|
if ( spendscriptstr != 0 && spendscriptstr[0] != 0 && (symbol= jstr(vals,"coin")) != 0 ) |
|
@ -582,26 +582,6 @@ STRING_ARRAY_OBJ_STRING(iguana,rawtx,changeaddr,addresses,vals,spendscriptstr) |
|
|
jaddbits256(retjson,"categoryhash",myinfo->bitcoin_category); |
|
|
jaddbits256(retjson,"categoryhash",myinfo->bitcoin_category); |
|
|
jaddnum(retjson,"timeout",5000); |
|
|
jaddnum(retjson,"timeout",5000); |
|
|
jaddstr(retjson,"hexmsg",buf); |
|
|
jaddstr(retjson,"hexmsg",buf); |
|
|
for (j=0; j<IGUANA_MAXCOINS; j++) |
|
|
|
|
|
{ |
|
|
|
|
|
if ( (coin= Coins[j]) == 0 ) |
|
|
|
|
|
continue; |
|
|
|
|
|
for (i=0; i<IGUANA_MAXPEERS; i++) |
|
|
|
|
|
{ |
|
|
|
|
|
if ( (addr= &coin->peers.active[i]) != 0 && addr->usock >= 0 ) |
|
|
|
|
|
{ |
|
|
|
|
|
if ( addr->supernet != 0 && strcmp(addr->ipaddr,remoteaddr) == 0 ) |
|
|
|
|
|
{ |
|
|
|
|
|
printf("send back rawtx_result addr->supernet.%u to (%s)\n",addr->supernet,addr->ipaddr); |
|
|
|
|
|
iguana_send_supernet(addr,jprint(retjson,0),0); |
|
|
|
|
|
free(rawtx); |
|
|
|
|
|
return(jprint(retjson,1)); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if ( 0 && addr->ipbits != 0 ) |
|
|
|
|
|
printf("i.%d (%s) vs (%s) %s\n",i,addr->ipaddr,remoteaddr,coin->symbol); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} else jaddstr(retjson,"result",rawtx); |
|
|
} else jaddstr(retjson,"result",rawtx); |
|
|
free(rawtx); |
|
|
free(rawtx); |
|
|
} else jaddstr(retjson,"error","couldnt create rawtx"); |
|
|
} else jaddstr(retjson,"error","couldnt create rawtx"); |
|
|