|
|
@ -603,22 +603,23 @@ void LP_coinsloop(void *_coins) |
|
|
|
|
|
|
|
int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int32_t pubsock,char *pushaddr,uint16_t myport) |
|
|
|
{ |
|
|
|
static uint32_t counter;//,numpeers;
|
|
|
|
struct iguana_info *coin,*ctmp; char *origipaddr; int32_t height,nonz = 0;//struct LP_peerinfo *peer,*tmp; uint32_t now;
|
|
|
|
static uint32_t counter; |
|
|
|
struct iguana_info *coin,*ctmp; char *origipaddr; uint32_t now; int32_t height,nonz = 0; |
|
|
|
if ( (origipaddr= myipaddr) == 0 ) |
|
|
|
origipaddr = "127.0.0.1"; |
|
|
|
if ( mypeer == 0 ) |
|
|
|
myipaddr = "127.0.0.1"; |
|
|
|
HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht
|
|
|
|
{ |
|
|
|
if ( coin->addr_listunspent_requested != 0 && time(NULL) > coin->lastpushtime+LP_ORDERBOOK_DURATION ) |
|
|
|
now = (uint32_t)time(NULL); |
|
|
|
if ( (coin->addr_listunspent_requested != 0 && now > coin->lastpushtime+LP_ORDERBOOK_DURATION*.5) || now > coin->lastpushtime+LP_ORDERBOOK_DURATION*5 ) |
|
|
|
{ |
|
|
|
//printf("PUSH addr_listunspent_requested %u\n",coin->addr_listunspent_requested);
|
|
|
|
coin->lastpushtime = (uint32_t)time(NULL); |
|
|
|
coin->lastpushtime = (uint32_t)now; |
|
|
|
LP_smartutxos_push(coin); |
|
|
|
coin->addr_listunspent_requested = 0; |
|
|
|
} |
|
|
|
if ( coin->electrum == 0 && coin->inactive == 0 && time(NULL) > coin->lastgetinfo+LP_GETINFO_INCR ) |
|
|
|
if ( coin->electrum == 0 && coin->inactive == 0 && now > coin->lastgetinfo+LP_GETINFO_INCR ) |
|
|
|
{ |
|
|
|
nonz++; |
|
|
|
if ( (height= LP_getheight(coin)) > coin->longestchain ) |
|
|
@ -627,7 +628,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int |
|
|
|
if ( 0 && coin->firstrefht != 0 ) |
|
|
|
printf(">>>>>>>>>> set %s longestchain %d (ref.%d [%d, %d])\n",coin->symbol,height,coin->firstrefht,coin->firstscanht,coin->lastscanht); |
|
|
|
} //else LP_mempoolscan(coin->symbol,zero);
|
|
|
|
coin->lastgetinfo = (uint32_t)time(NULL); |
|
|
|
coin->lastgetinfo = (uint32_t)now; |
|
|
|
} |
|
|
|
} |
|
|
|
counter++; |
|
|
|