Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
4d08a56c10
  1. 5
      iguana/iguana777.c
  2. 1
      iguana/iguana_accept.c
  3. 2
      iguana/iguana_instantdex.c

5
iguana/iguana777.c

@ -154,17 +154,18 @@ int32_t iguana_inv2poll(struct supernet_info *myinfo,struct iguana_info *coin)
for (i=n=0; i<coin->MAXPEERS; 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);
if ( addr->usock >= 0 && addr->dead == 0 && addr->ready != 0 && addr->ipbits != 0 )
{
instantdex_inv2data(myinfo,coin,addr,exchange);
n++;
}
}
}
}
}
return(n);
}

1
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;

2
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);

Loading…
Cancel
Save