|
@ -253,6 +253,11 @@ char *dex_response(struct supernet_info *myinfo,struct dex_nanomsghdr *dexp) |
|
|
printf("SEND.(%s) datalen.%d strlen.%ld\n",(char *)&dexp->packet[datalen],datalen,strlen((char *)&dexp->packet[datalen])); |
|
|
printf("SEND.(%s) datalen.%d strlen.%ld\n",(char *)&dexp->packet[datalen],datalen,strlen((char *)&dexp->packet[datalen])); |
|
|
retstr = dpow_sendrawtransaction(myinfo,coin,(char *)&dexp->packet[datalen]); |
|
|
retstr = dpow_sendrawtransaction(myinfo,coin,(char *)&dexp->packet[datalen]); |
|
|
} |
|
|
} |
|
|
|
|
|
else if ( dexreq.func == 'A' ) |
|
|
|
|
|
{ |
|
|
|
|
|
printf("address.(%s) datalen.%d strlen.%ld\n",(char *)&dexp->packet[datalen],datalen,strlen((char *)&dexp->packet[datalen])); |
|
|
|
|
|
retstr = dpow_importaddress(myinfo,coin,(char *)&dexp->packet[datalen]); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
if ( retstr == 0 ) |
|
|
if ( retstr == 0 ) |
|
|
return(clonestr("{\"error\":\"null return\"}")); |
|
|
return(clonestr("{\"error\":\"null return\"}")); |
|
@ -343,6 +348,22 @@ char *_dex_sendrawtransaction(struct supernet_info *myinfo,char *symbol,char *si |
|
|
return(retstr); |
|
|
return(retstr); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
char *_dex_importaddress(struct supernet_info *myinfo,char *symbol,char *address) |
|
|
|
|
|
{ |
|
|
|
|
|
struct dex_request dexreq; uint8_t *packet; int32_t datalen; char *retstr; |
|
|
|
|
|
packet = calloc(1,sizeof(dexreq)+strlen(address)+1); |
|
|
|
|
|
memset(&dexreq,0,sizeof(dexreq)); |
|
|
|
|
|
safecopy(dexreq.name,symbol,sizeof(dexreq.name)); |
|
|
|
|
|
dexreq.func = 'A'; |
|
|
|
|
|
datalen = dex_rwrequest(1,packet,&dexreq); |
|
|
|
|
|
strcpy((char *)&packet[datalen],address); |
|
|
|
|
|
printf("address.(%s) datalen.%d strlen.%ld\n",(char *)&packet[datalen],datalen,strlen(address)); |
|
|
|
|
|
datalen += strlen(address) + 1; |
|
|
|
|
|
retstr = dex_reqsend(myinfo,"request",packet,datalen); |
|
|
|
|
|
free(packet); |
|
|
|
|
|
return(retstr); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
int32_t dex_crc32find(struct supernet_info *myinfo,uint32_t crc32) |
|
|
int32_t dex_crc32find(struct supernet_info *myinfo,uint32_t crc32) |
|
|
{ |
|
|
{ |
|
|
int32_t i,firstz = -1; |
|
|
int32_t i,firstz = -1; |
|
|