Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
b74e2c9a50
  1. 4
      crypto777/bitcoind_RPC.c
  2. 3
      iguana/exchanges/bitcoin.c

4
crypto777/bitcoind_RPC.c

@ -163,7 +163,7 @@ try_again:
databuf = (char *)malloc(256 + strlen(command) + strlen(params));
sprintf(databuf,"{\"id\":\"jl777\",\"method\":\"%s\",\"params\":%s%s%s}",command,bracket0,params,bracket1);
//printf("url.(%s) userpass.(%s) databuf.(%s)\n",url,userpass,databuf);
printf("url.(%s) userpass.(%s) databuf.(%s)\n",url,userpass,databuf);
//
} //else if ( specialcase != 0 ) fprintf(stderr,"databuf.(%s)\n",params);
curl_easy_setopt(curl_handle,CURLOPT_POST,1L);
@ -189,7 +189,7 @@ try_again:
free(s.ptr);
return(0);
}
else if ( numretries >= 1 )
else if ( numretries >= 2 )
{
printf("Maximum number of retries exceeded!\n");
free(s.ptr);

3
iguana/exchanges/bitcoin.c

@ -1474,9 +1474,10 @@ struct bitcoin_unspent *iguana_unspentsget(struct supernet_info *myinfo,struct i
sprintf(params,"%.0f, 99999999",minconfirms);
if ( (retstr= bitcoind_passthru(coin->symbol,coin->chain->serverport,coin->chain->userpass,"listunspent",params)) != 0 )
{
printf("unspents.(%s)\n",retstr);
if ( (utxo= cJSON_Parse(retstr)) != 0 )
{
if ( (*numunspentsp= cJSON_GetArraySize(utxo)) > 0 )
if ( (*numunspentsp= cJSON_GetArraySize(jobj(utxo,"result"))) > 0 )
{
unspents = calloc(*numunspentsp,sizeof(*unspents));
for (i=n=0; i<*numunspentsp; i++)

Loading…
Cancel
Save