|
|
@ -413,13 +413,14 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) |
|
|
|
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 *retstr,*origipaddr; struct LP_peerinfo *peer,*tmp; uint32_t now; bits256 zero; int32_t height,nonz = 0; |
|
|
|
struct iguana_info *coin,*ctmp; char *retstr,*origipaddr; struct LP_peerinfo *peer,*tmp; uint32_t now; bits256 zero; int32_t needpings,height,nonz = 0; |
|
|
|
now = (uint32_t)time(NULL); |
|
|
|
if ( (origipaddr= myipaddr) == 0 ) |
|
|
|
origipaddr = "127.0.0.1"; |
|
|
|
if ( mypeer == 0 ) |
|
|
|
myipaddr = "127.0.0.1"; |
|
|
|
numpeers = LP_numpeers(); |
|
|
|
needpings = 0; |
|
|
|
HASH_ITER(hh,LP_peerinfos,peer,tmp) |
|
|
|
{ |
|
|
|
if ( peer->errors >= LP_MAXPEER_ERRORS ) |
|
|
@ -450,11 +451,17 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int |
|
|
|
} |
|
|
|
if ( peer->needping != 0 ) |
|
|
|
{ |
|
|
|
needpings++; |
|
|
|
if ( (retstr= issue_LP_notify(peer->ipaddr,peer->port,"127.0.0.1",0,numpeers,G.LP_sessionid,G.LP_myrmd160str,G.LP_mypub25519)) != 0 ) |
|
|
|
free(retstr); |
|
|
|
peer->needping = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
if ( needpings != 0 ) |
|
|
|
{ |
|
|
|
printf("needpings.%d send notify\n",needpings); |
|
|
|
LP_notify_pubkeys(ctx,pubsock); |
|
|
|
} |
|
|
|
if ( (counter % 6000) == 10 ) |
|
|
|
{ |
|
|
|
LP_privkey_updates(ctx,pubsock,0); |
|
|
|