jl777 7 years ago
parent
commit
91004439c8
  1. 1
      iguana/exchanges/LP_nativeDEX.c
  2. 3
      iguana/exchanges/LP_socket.c

1
iguana/exchanges/LP_nativeDEX.c

@ -18,6 +18,7 @@
// LP_nativeDEX.c
// marketmaker
//
// electrum swaps efficiency
// process stats.log local file -> map of realtime activity!
// select oldest utxo first
// handles <-> pubkeys, deal with offline pubkeys, reputations, bonds etc.

3
iguana/exchanges/LP_socket.c

@ -373,6 +373,7 @@ cJSON *electrum_submit(char *symbol,struct electrum_info *ep,cJSON **retjsonp,ch
{
*retjsonp = 0;
sprintf(stratumreq,"{ \"jsonrpc\":\"2.0\", \"id\": %u, \"method\":\"%s\", \"params\": %s }\n",ep->stratumid,method,params);
printf("%s\n",stratumreq);
memset(ep->buf,0,ep->bufsize);
sitem = (struct stritem *)queueitem(stratumreq);
sitem->expiration = timeout;
@ -522,7 +523,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON
{
if ( (retjson= electrum_strarg(symbol,ep,retjsonp,"blockchain.address.listunspent",addr,ELECTRUM_TIMEOUT)) != 0 )
{
//printf("%s %p u.%u t.%ld %s -> %s LISTUNSPENT.(%ld)\n",coin->symbol,&coin->unspenttime,coin->unspenttime,time(NULL),coin->lastunspent,addr,strlen(jprint(retjson,0)));
printf("%s %p u.%u t.%ld %s -> %s LISTUNSPENT.(%ld)\n",coin->symbol,&coin->unspenttime,coin->unspenttime,time(NULL),coin->lastunspent,addr,strlen(jprint(retjson,0)));
if ( electrum_process_array(coin,ep,addr,retjson,electrumflag) != 0 )
LP_postutxos(coin->symbol,addr);
safecopy(coin->lastunspent,addr,sizeof(coin->lastunspent));

Loading…
Cancel
Save