Browse Source

Test

etomic
jl777 7 years ago
parent
commit
42f12364fb
  1. 5
      iguana/exchanges/LP_rpc.c
  2. 6
      iguana/exchanges/LP_socket.c

5
iguana/exchanges/LP_rpc.c

@ -284,7 +284,6 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout)
sprintf(buf,"[\"%s\"]",bits256_str(str,txid));
if ( (hexobj= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 )
{
printf("hexobj.(%s)\n",jprint(hexobj,0));
hexstr = jprint(hexobj,1);
if ( hexstr[0] == '"' && hexstr[strlen(hexstr)-1] == '"' )
hexstr[strlen(hexstr)-1] = 0;
@ -294,10 +293,10 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout)
serialized = malloc(len);
decode_hex(serialized,len,hexstr+1);
LP_swap_coinaddr(coin,coinaddr,&value,serialized,len,vout);
printf("HEX.(%s) len.%d %s %.8f\n",hexstr+1,len,coinaddr,dstr(value));
//printf("HEX.(%s) len.%d %s %.8f\n",hexstr+1,len,coinaddr,dstr(value));
if ( (array= electrum_address_listunspent(coin->symbol,0,&array,coinaddr)) != 0 )
{
printf("array.(%s)\n",jprint(array,0));
//printf("array.(%s)\n",jprint(array,0));
if ( array != 0 && (n= cJSON_GetArraySize(array)) > 0 )
{
for (i=0; i<n; i++)

6
iguana/exchanges/LP_socket.c

@ -523,7 +523,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len)
if ( (strjson= cJSON_Parse(str)) != 0 )
{
resultjson = jobj(strjson,"result");
printf("strjson.(%s)\n",jprint(strjson,0));
//printf("strjson.(%s)\n",jprint(strjson,0));
if ( (method= jstr(strjson,"method")) != 0 )
{
if ( strcmp(method,"blockchain.headers.subscribe") == 0 )
@ -554,7 +554,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len)
stritem = (struct stritem *)item;
if ( item->type == idnum )
{
printf("matched idnum.%d result.%p\n",idnum,resultjson);
//printf("matched idnum.%d result.%p\n",idnum,resultjson);
DL_DELETE(ep->pendingQ.list,item);
*((cJSON **)stritem->retptrp) = (resultjson != 0 ? jduplicate(resultjson) : strjson);
resultjson = strjson = 0;
@ -624,7 +624,7 @@ void LP_dedicatedloop(void *arg)
}
DL_APPEND(ep->pendingQ.list,&sitem->DL);
portable_mutex_unlock(&ep->pendingQ.mutex);*/
printf("%p SEND.(%s) to %s:%u\n",sitem,sitem->str,ep->ipaddr,ep->port);
//printf("%p SEND.(%s) to %s:%u\n",sitem,sitem->str,ep->ipaddr,ep->port);
queue_enqueue("pendingQ",&ep->pendingQ,&sitem->DL);
flag++;
}

Loading…
Cancel
Save