From 4d08a56c1003570d87bb371c20d64cc66dfe7088 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 12 May 2016 23:34:17 -0500 Subject: [PATCH] test --- iguana/iguana777.c | 9 +++++---- iguana/iguana_accept.c | 1 + iguana/iguana_instantdex.c | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/iguana/iguana777.c b/iguana/iguana777.c index 3b1cbccdd..0b4d3978f 100755 --- a/iguana/iguana777.c +++ b/iguana/iguana777.c @@ -154,13 +154,14 @@ int32_t iguana_inv2poll(struct supernet_info *myinfo,struct iguana_info *coin) for (i=n=0; iMAXPEERS; i++) { addr = &coin->peers.active[i]; - if ( addr->usock < 0 || addr->dead != 0 || addr->ready == 0 || addr->ipbits == 0 ) - continue; if ( addr->supernet != 0 ) { printf("iguana_inv2poll (%s) usock.%d dead.%u ready.%u ipbits.%u supernet.%d\n",addr->ipaddr,addr->usock,addr->dead,addr->ready,(uint32_t)addr->ipbits,addr->supernet); - instantdex_inv2data(myinfo,coin,addr,exchange); - n++; + if ( addr->usock >= 0 && addr->dead == 0 && addr->ready != 0 && addr->ipbits != 0 ) + { + instantdex_inv2data(myinfo,coin,addr,exchange); + n++; + } } } } diff --git a/iguana/iguana_accept.c b/iguana/iguana_accept.c index d6af4be5a..0d3dd8dc2 100755 --- a/iguana/iguana_accept.c +++ b/iguana/iguana_accept.c @@ -102,6 +102,7 @@ void iguana_acceptloop(void *args) { printf("found existing peer.(%s) in slot[%d]\n",ipaddr,i); close(coin->peers.active[i].usock); + coin->peers.active[i].dead = 0; coin->peers.active[i].usock = sock; coin->peers.active[i].ready = (uint32_t)time(NULL); flag = 1; diff --git a/iguana/iguana_instantdex.c b/iguana/iguana_instantdex.c index 9ad15bd0a..9e3a93ddd 100755 --- a/iguana/iguana_instantdex.c +++ b/iguana/iguana_instantdex.c @@ -827,7 +827,7 @@ int32_t instantdex_inv2data(struct supernet_info *myinfo,struct iguana_info *coi { if ( now < ap->offer.expiration && ap->dead == 0 ) { - if ( n < sizeof(hashes)/sizeof(*hashes) && GETBIT(ap->peerhas,addr->addrind) == 0 ) + if ( n < sizeof(hashes)/sizeof(*hashes) )//&& GETBIT(ap->peerhas,addr->addrind) == 0 ) hashes[n++] = instantdex_encodehash(ap->offer.base,ap->offer.rel,ap->offer.price64*instantdex_bidaskdir(&ap->offer),ap->orderid,ap->offer.offer64); queue_enqueue("acceptableQ",&exchange->acceptableQ,&ap->DL,0); } else free(ap);