Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
fcd67ed9b1
  1. 2
      iguana/iguana777.h
  2. 1
      iguana/iguana_blocks.c
  3. 11
      iguana/iguana_bundles.c
  4. 15
      iguana/iguana_recv.c

2
iguana/iguana777.h

@ -798,6 +798,8 @@ void iguana_coinflush(struct iguana_info *coin,int32_t forceflag);
int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int32_t starti,int32_t max);
void iguana_balancecalc(struct iguana_info *coin,struct iguana_bundle *bp);
int32_t iguana_sendblockreqPT(struct iguana_info *coin,struct iguana_peer *addr,struct iguana_bundle *bp,int32_t bundlei,bits256 hash2,int32_t iamthreadsafe);
int32_t iguana_blockreq(struct iguana_info *coin,int32_t height,int32_t priority);
extern int32_t HDRnet,netBLOCKS;
extern queue_t bundlesQ,validateQ,emitQ,balancesQ;

1
iguana/iguana_blocks.c

@ -363,6 +363,7 @@ struct iguana_block *_iguana_chainlink(struct iguana_info *coin,struct iguana_bl
//if ( block->fpipbits == 0 )
// iguana_blockQ(coin,bp,block->height % coin->chain->bundlesize,block->RO.hash2,1);
block->mainchain = 1;
iguana_blockreq(coin,block->height+1,0);
return(block);
}
}

11
iguana/iguana_bundles.c

@ -451,9 +451,8 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int
if ( peercounts[i] == 0 && donecounts[i] > 10 )
finished++;
}
if ( finished > laggard*10 && numpeers > 2*laggard )
if ( finished > laggard*10 && numpeers > 2*laggard && laggard > 0 )
{
printf("90%% finished %d, laggards.%d\n",finished,laggard);
for (i=laggard=finished=0; i<numpeers; i++)
{
if ( peercounts[i] > 10 && (addr= coin->peers.ranked[i]) != 0 && now > bp->currenttime+30 )
@ -471,17 +470,17 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int
printf("kill peer.%d %s reissued\n",i,addr->ipaddr);
}
}
for (i=0; i<numpeers; i++)
printf("%d ",peercounts[i]);
printf("peercounts, 90%% finished %d, laggards.%d\n",finished,laggard);
}
for (i=0; i<numpeers; i++)
printf("%d ",peercounts[i]);
printf("peercounts\n");
for (i=0; i<bp->n; i++)
if ( (block= bp->blocks[i]) != 0 && block->fpipbits == 0 && now > block->issued+10 )
{
iguana_blockQ("kick",coin,bp,i,block->RO.hash2,1);
printf("[%d:%d] ",bp->hdrsi,i);
}
printf("currentflag.%d ht.%d s.%d done.%d maxunfinished.%d\n",bp->currentflag,bp->bundleheight,bp->numsaved,doneval,maxval);
printf("currentflag.%d ht.%d s.%d finished.%d most.%d laggards.%d maxunfinished.%d\n",bp->currentflag,bp->bundleheight,bp->numsaved,finished,doneval,laggard,maxval);
}
/*if ( doneval != maxval )
{

15
iguana/iguana_recv.c

@ -694,6 +694,19 @@ struct iguana_bundlereq *iguana_recvunconfirmed(struct iguana_info *coin,struct
return(req);
}
int32_t iguana_blockreq(struct iguana_info *coin,int32_t height,int32_t priority)
{
int32_t hdrsi,bundlei; struct iguana_bundle *bp;
hdrsi = height / coin->chain->bundlesize;
bundlei = height % coin->chain->bundlesize;
if ( (bp= coin->bundles[hdrsi]) != 0 && bits256_nonz(bp->hashes[bundlei]) != 0 )
{
iguana_blockQ("blockreq",coin,bp,hdrsi,bp->speculative[bundlei],priority);
return(height);
}
return(-1);
}
int32_t iguana_reqblocks(struct iguana_info *coin)
{
int32_t hdrsi,lflag,bundlei,flag = 0; bits256 hash2; struct iguana_block *next,*block; struct iguana_bundle *bp;
@ -796,7 +809,7 @@ int32_t iguana_reqblocks(struct iguana_info *coin)
iguana_blockQ("reqblocks1",coin,bp,bundlei,bp->hashes[bundlei],0);
}
}
}
}
if ( next != 0 )
{
//printf("have next %d\n",coin->blocks.hwmchain.height);

Loading…
Cancel
Save