Browse Source

Test

etomic
jl777 8 years ago
parent
commit
1ee4dbc6b2
  1. 2
      iguana/exchanges/LP_include.h
  2. 3
      iguana/exchanges/LP_nativeDEX.c

2
iguana/exchanges/LP_include.h

@ -181,7 +181,7 @@ struct LP_peerinfo
UT_hash_handle hh; UT_hash_handle hh;
uint64_t ip_port; uint64_t ip_port;
double profitmargin; double profitmargin;
uint32_t ipbits,errortime,errors,numpeers,numutxos,lasttime,connected,lastutxos; uint32_t ipbits,errortime,errors,numpeers,numutxos,lasttime,connected,lastutxos,lastpeers;
int32_t pushsock,subsock; int32_t pushsock,subsock;
uint16_t port; uint16_t port;
char ipaddr[64]; char ipaddr[64];

3
iguana/exchanges/LP_nativeDEX.c

@ -183,8 +183,9 @@ void LP_mainloop(struct LP_peerinfo *mypeer,uint16_t mypubport,int32_t pubsock,i
now = (uint32_t)time(NULL); now = (uint32_t)time(NULL);
HASH_ITER(hh,LP_peerinfos,peer,tmp) HASH_ITER(hh,LP_peerinfos,peer,tmp)
{ {
if ( peer->numpeers > 0 && (peer->numpeers != mypeer->numpeers || (rand() % 10000) == 0) ) if ( now > peer->lastpeers+60 && peer->numpeers > 0 && (peer->numpeers != mypeer->numpeers || (rand() % 10000) == 0) )
{ {
peer->lastpeers = now;
if ( peer->numpeers != mypeer->numpeers ) if ( peer->numpeers != mypeer->numpeers )
printf("%s num.%d vs %d\n",peer->ipaddr,peer->numpeers,mypeer->numpeers); printf("%s num.%d vs %d\n",peer->ipaddr,peer->numpeers,mypeer->numpeers);
if ( strcmp(peer->ipaddr,mypeer->ipaddr) != 0 ) if ( strcmp(peer->ipaddr,mypeer->ipaddr) != 0 )

Loading…
Cancel
Save