Browse Source

Test

etomic
jl777 7 years ago
parent
commit
20799a1f89
  1. 2
      iguana/exchanges/LP_rpc.c
  2. 6
      iguana/exchanges/LP_socket.c

2
iguana/exchanges/LP_rpc.c

@ -132,6 +132,8 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params)
}
else
{
if ( strcmp(method,"listunspent") == 0 )
method = "blockchain.address.listunspent";
retjson = electrum_submit(coin->symbol,coin->electrum,0,method,params,LP_HTTP_TIMEOUT);
printf("electrum %s.%s -> (%s)\n",method,params,jprint(retjson,0));
}

6
iguana/exchanges/LP_socket.c

@ -503,12 +503,12 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len)
if ( (strjson= cJSON_Parse(str)) != 0 )
{
resultjson = jobj(strjson,"result");
printf("result.(%s)\n",jprint(resultjson,0));
//printf("result.(%s)\n",jprint(resultjson,0));
if ( (method= jstr(strjson,"method")) != 0 )
{
if ( strcmp(method,"blockchain.headers.subscribe") == 0 )
{
printf("%p headers.(%s)\n",strjson,jprint(strjson,0));
//printf("%p headers.(%s)\n",strjson,jprint(strjson,0));
if ( (paramsjson= jarray(&n,strjson,"params")) != 0 )
{
for (i=0; i<n; i++)
@ -522,7 +522,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len)
{
*(ep->heightp) = height;
*(ep->heighttimep) = (uint32_t)time(NULL);
printf("set height.%d\n",height);
printf(">>>>>>>>> set height.%d\n",height);
}
}
idnum = juint(strjson,"id");

Loading…
Cancel
Save