diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 558867e62..ceea4a5be 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -237,7 +237,7 @@ void LP_mainloop(char *myipaddr,struct LP_peerinfo *mypeer,uint16_t mypubport,in lastforward = now; } nonz = n = 0; - if ( (++counter % 6000) == 0 ) + if ( (counter % 6000) == 0 ) LP_utxo_updates(pubsock,passphrase,profitmargin); HASH_ITER(hh,LP_peerinfos,peer,tmp) { @@ -251,8 +251,9 @@ void LP_mainloop(char *myipaddr,struct LP_peerinfo *mypeer,uint16_t mypubport,in lastforward = now; } } - //if ( nonz == 0 ) + if ( nonz == 0 ) usleep(200000); + counter++; } } else @@ -289,8 +290,9 @@ void LP_mainloop(char *myipaddr,struct LP_peerinfo *mypeer,uint16_t mypubport,in } if ( pullsock >= 0 ) nonz += LP_pullsock_check(myipaddr,pubsock,pullsock,profitmargin); - //if ( nonz == 0 ) + if ( nonz == 0 ) usleep(100000); + counter++; //printf("nonz.%d in mainloop\n",nonz); } }