From d67fdb6406a6dbaa1c015896b144b05f2fd3dd8c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 9 Sep 2017 22:18:05 +0200 Subject: [PATCH] Test --- iguana/exchanges/LP_socket.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index a353d0e7c..e8999a062 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -294,13 +294,18 @@ cJSON *electrum_submit(char *method,char *params,int32_t timeout) static uint32_t stratumid; // queue id and string and callback char stratumreq[16384]; + sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",stratumid++,method,params); + printf("submit.(%s)\n",stratumreq); while ( LP_sendstr != 0 ) usleep(10000); + printf("clear buf\n"); ((char *)LP_electrum_buf)[0] = 0; - sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",stratumid++,method,params); LP_sendstr = stratumreq; while ( LP_sendstr != 0 ) usleep(10000); + printf("wait for return\n"); + while ( ((char *)LP_electrum_buf)[0] == 0 ) + usleep(10000); if ( ((char *)LP_electrum_buf)[0] != 0 ) return(cJSON_Parse(LP_electrum_buf)); else return(0);