Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
52b69abacc
  1. 2
      iguana/iguana777.h
  2. 10
      iguana/iguana_bundles.c

2
iguana/iguana777.h

@ -41,7 +41,7 @@ typedef int32_t (*blockhashfunc)(uint8_t *blockhashp,uint8_t *serialized,int32_t
#define IGUANA_HEADPERCENTAGE 0. #define IGUANA_HEADPERCENTAGE 0.
#define IGUANA_TAILPERCENTAGE 1.0 #define IGUANA_TAILPERCENTAGE 1.0
#define IGUANA_MAXPENDHDRS 1 #define IGUANA_MAXPENDHDRS 1
#define _IGUANA_MAXPENDING 3 #define _IGUANA_MAXPENDING 8
#define IGUANA_MINPENDBUNDLES 2 #define IGUANA_MINPENDBUNDLES 2
#define IGUANA_MAXPENDBUNDLES 64 #define IGUANA_MAXPENDBUNDLES 64
#define IGUANA_BUNDLELOOP 77 #define IGUANA_BUNDLELOOP 77

10
iguana/iguana_bundles.c

@ -941,6 +941,11 @@ int32_t iguana_bundleiters(struct iguana_info *coin,struct OS_memspace *mem,stru
} }
for (i=n=0; i<bp->n; i++) for (i=n=0; i<bp->n; i++)
{ {
if ( lag < coin->MAXSTUCKTIME )
{
if ( bits256_nonz(bp->hashes[i]) != 0 )
iguana_blockQ("stuck",coin,bp,i,bp->hashes[i],0);
}
if ( (block= bp->blocks[i]) != 0 && (block->RO.recvlen == 0 || block->fpos < 0 || block->fpipbits == 0 || bits256_nonz(block->RO.prev_block) == 0) ) if ( (block= bp->blocks[i]) != 0 && (block->RO.recvlen == 0 || block->fpos < 0 || block->fpipbits == 0 || bits256_nonz(block->RO.prev_block) == 0) )
{ {
if ( time(NULL) > block->issued+10 ) if ( time(NULL) > block->issued+10 )
@ -1054,13 +1059,14 @@ void iguana_bundlestats(struct iguana_info *coin,char *str)
} // else break; } // else break;
} }
} }
else if ( bp == coin->current ) else if ( 0 && bp == coin->current )
{ {
for (j=0; j<bp->n; j++) for (j=0; j<bp->n; j++)
if ( (block= bp->blocks[j]) != 0 && (block->RO.recvlen == 0 || block->fpipbits == 0 || block->fpos < 0) && time(NULL) > block->issued+3 && (rand() % 10) == 0 ) if ( (block= bp->blocks[j]) != 0 && (block->RO.recvlen == 0 || block->fpipbits == 0 || block->fpos < 0) && time(NULL) > block->issued+3 && (rand() % 10) == 0 )
{ {
if ( (r= coin->peers.numranked) != 0 && (addr= coin->peers.ranked[rand() % r]) != 0 && addr->dead == 0 && addr->usock >= 0 ) if ( (r= coin->peers.numranked) != 0 && (addr= coin->peers.ranked[rand() % r]) != 0 && addr->dead == 0 && addr->usock >= 0 )
iguana_sendblockreqPT(coin,addr,bp,j,block->RO.hash2,0); printf("kick [%d:%d]\n",bp->hdrsi,j); iguana_sendblockreqPT(coin,addr,bp,j,block->RO.hash2,0);
printf("currentstop [%d:%d]\n",bp->hdrsi,j);
iguana_blockQ("currentstop",coin,bp,j,block->RO.hash2,1); iguana_blockQ("currentstop",coin,bp,j,block->RO.hash2,1);
block->issued = (uint32_t)time(NULL); block->issued = (uint32_t)time(NULL);
break; break;

Loading…
Cancel
Save