Browse Source

Reduce latency

beta
jl777 7 years ago
parent
commit
a6d7dfddc0
  1. 2
      iguana/exchanges/LP_include.h
  2. 7
      iguana/exchanges/LP_nativeDEX.c

2
iguana/exchanges/LP_include.h

@ -185,7 +185,7 @@ struct iguana_info
portable_mutex_t txmutex,addrmutex; struct LP_transaction *transactions; struct LP_address *addresses;
uint64_t txfee;
int32_t longestchain,firstrefht,firstscanht,lastscanht,bussock,height; uint16_t busport;
uint32_t addr_listunspent_requested,lastutxos,updaterate,counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor,unspenttime,obooktime;
uint32_t lastutxosync,addr_listunspent_requested,lastutxos,updaterate,counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor,unspenttime,obooktime;
uint8_t pubtype,p2shtype,isPoS,wiftype,wiftaddr,taddr,noimportprivkey_flag,userconfirms,isassetchain,maxconfirms;
char symbol[16],smartaddr[64],userpass[1024],serverport[128],lastunspent[64];
// portfolio

7
iguana/exchanges/LP_nativeDEX.c

@ -356,6 +356,9 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer)
continue;
if ( coin->smartaddr[0] == 0 )
continue;
if ( coin->lastutxosync != 0 && time(NULL) < coin->lastutxosync+60 )
continue;
coin->lastutxosync = (uint32_t)time(NULL);
total = 0;
if ( (j= LP_listunspent_both(coin->symbol,coin->smartaddr,0)) == 0 )
continue;
@ -495,8 +498,8 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int
{
nonz++;
LP_peersquery(mypeer,pubsock,peer->ipaddr,peer->port,myipaddr,myport);
needpings++;
peer->diduquery = 0;
LP_utxos_sync(peer);
}
peer->lastpeers = now;
}
@ -505,7 +508,6 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int
nonz++;
needpings++;
LP_peer_pricesquery(peer);
LP_utxos_sync(peer);
peer->diduquery = now;
}
if ( peer->needping != 0 )
@ -522,6 +524,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int
nonz++;
//printf("needpings.%d send notify\n",needpings);
LP_notify_pubkeys(ctx,pubsock);
LP_utxos_sync(peer);
}
if ( (counter % 6000) == 10 )
{

Loading…
Cancel
Save