Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
2598dadf04
  1. 2
      iguana/iguana_peers.c
  2. 6
      iguana/iguana_recv.c

2
iguana/iguana_peers.c

@ -759,7 +759,7 @@ int32_t iguana_pollsendQ(struct iguana_info *coin,struct iguana_peer *addr)
struct iguana_packet *packet; struct iguana_packet *packet;
if ( (packet= queue_dequeue(&addr->sendQ,0)) != 0 ) if ( (packet= queue_dequeue(&addr->sendQ,0)) != 0 )
{ {
//if ( addr->supernet != 0 || strcmp((char *)&packet->serialized[4],"SuperNET") == 0 ) if ( addr->supernet != 0 || strcmp((char *)&packet->serialized[4],"SuperNET") == 0 )
printf("%s: send.(%s) usock.%d dead.%u ready.%u supernet.%d\n",addr->ipaddr,packet->serialized+4,addr->usock,addr->dead,addr->ready,addr->supernet); printf("%s: send.(%s) usock.%d dead.%u ready.%u supernet.%d\n",addr->ipaddr,packet->serialized+4,addr->usock,addr->dead,addr->ready,addr->supernet);
if ( strcmp((char *)&packet->serialized[4],"getdata") == 0 ) if ( strcmp((char *)&packet->serialized[4],"getdata") == 0 )
{ {

6
iguana/iguana_recv.c

@ -580,9 +580,9 @@ int32_t iguana_needhdrs(struct iguana_info *coin)
int32_t iguana_reqhdrs(struct iguana_info *coin) int32_t iguana_reqhdrs(struct iguana_info *coin)
{ {
int32_t i,lag,n = 0; struct iguana_bundle *bp; char hashstr[65]; int32_t i,lag,n = 0; struct iguana_bundle *bp; char hashstr[65];
if ( iguana_needhdrs(coin) > 0 )//&& queue_size(&coin->hdrsQ) == 0 ) if ( iguana_needhdrs(coin) > 0 && queue_size(&coin->hdrsQ) == 0 )
{ {
//if ( coin->zcount++ > 1 ) if ( coin->zcount++ > 1 )
{ {
for (i=0; i<coin->bundlescount; i++) for (i=0; i<coin->bundlescount; i++)
{ {
@ -590,7 +590,7 @@ int32_t iguana_reqhdrs(struct iguana_info *coin)
{ {
if ( i == coin->bundlescount-1 ) if ( i == coin->bundlescount-1 )
lag = 5; lag = 5;
else lag = 30 + (rand() % 30); else lag = 3 + (rand() % 13);
//if ( i < coin->bundlescount-1 && (bp->numhashes >= (rand() % bp->n) || time(NULL) < bp->hdrtime+lag) ) //if ( i < coin->bundlescount-1 && (bp->numhashes >= (rand() % bp->n) || time(NULL) < bp->hdrtime+lag) )
// continue; // continue;
if ( bp->numhashes < bp->n && bp->bundleheight+bp->numhashes < coin->longestchain && time(NULL) > bp->issuetime+lag ) if ( bp->numhashes < bp->n && bp->bundleheight+bp->numhashes < coin->longestchain && time(NULL) > bp->issuetime+lag )

Loading…
Cancel
Save