Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
4e68e4c4ee
  1. 12
      iguana/iguana_bundles.c
  2. 6
      iguana/iguana_recv.c

12
iguana/iguana_bundles.c

@ -641,7 +641,7 @@ int32_t iguana_bundlehdr(struct iguana_info *coin,struct iguana_bundle *bp,int32
printf("hdr ITERATE.%d bundle.%d vs %d: h.%d n.%d r.%d s.%d finished.%d speculative.%p[%d]\n",bp->hdrsi,bp->bundleheight,coin->longestchain-coin->chain->bundlesize,bp->numhashes,bp->n,bp->numrecv,bp->numsaved,bp->emitfinish,bp->speculative,bp->numspec);
queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(bits256_str(str,bp->hashes[0])),1);
}
if ( bp->speculative != 0 )
if ( bp->speculative != 0 && bp == coin->current )
{
now = (uint32_t)time(NULL);
for (i=0; i<bp->numspec; i++)
@ -656,8 +656,8 @@ int32_t iguana_bundlehdr(struct iguana_info *coin,struct iguana_bundle *bp,int32
}
//break;
}
//else if ( bp->blocks[i] == 0 )
// break;
else if ( bp->blocks[i] == 0 )
break;
}
}
return(counter);
@ -808,10 +808,10 @@ int32_t iguana_bundlefinish(struct iguana_info *coin,struct iguana_bundle *bp)
}
#endif
for (i=0; i<bp->hdrsi; i++)
if ( (prevbp= coin->bundles[i]) == 0 || prevbp->emitfinish < coin->startutc || (i < bp->hdrsi-IGUANA_NUMHELPERS && prevbp->utxofinish <= 1)
if ( (prevbp= coin->bundles[i]) == 0 || prevbp->emitfinish < coin->startutc || (i < bp->hdrsi-IGUANA_NUMHELPERS/3 && prevbp->utxofinish <= 1)
)
break;
if ( i == bp->hdrsi && coin->emitbusy <= (coin->MAXBUNDLES>>1) )
if ( i == bp->hdrsi && coin->emitbusy <= (IGUANA_NUMHELPERS/3) )
{
if ( bp->startutxo == 0 )
{
@ -905,7 +905,7 @@ int32_t iguana_bundleiters(struct iguana_info *coin,struct OS_memspace *mem,stru
counter = iguana_bundleissue(coin,bp,max,timelimit);
if ( bp == coin->current && coin->isRT == 0 )
bp->nexttime--;
if ( bp == coin->current )
if ( 0 && bp == coin->current && counter > 0 )
printf("ITER.rt%d now.%u spec.%-4d bundle.%-4d h.%-4d r.%-4d s.%-4d F.%d T.%d issued.%d mb.%d/%d\n",bp->isRT,(uint32_t)time(NULL),bp->numspec,bp->bundleheight/coin->chain->bundlesize,bp->numhashes,bp->numrecv,bp->numsaved,bp->emitfinish,timelimit,counter,coin->MAXBUNDLES,coin->bundlescount);
if ( bp->hdrsi == starti && bp->isRT == 0 )
{

6
iguana/iguana_recv.c

@ -315,7 +315,7 @@ void iguana_gotblockhashesM(struct iguana_info *coin,struct iguana_peer *addr,bi
req = iguana_bundlereq(coin,addr,'S',0);
req->hashes = blockhashes, req->n = n;
char str[65];
if ( 0 && n > 2 )
//if ( 0 && n > 2 )
printf("bundlesQ blockhashes.%s [%d]\n",bits256_str(str,blockhashes[1]),n);
queue_enqueue("recvQ",&coin->recvQ,&req->DL,0);
}
@ -432,7 +432,7 @@ void iguana_bundlespeculate(struct iguana_info *coin,struct iguana_bundle *bp,in
fprintf(stderr,"Afound block -> %d %d hdr.%s\n",bp->bundleheight,coin->longestchain-coin->chain->bundlesize,str);
queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(str),1);
}
else if ( bp->speculative != 0 && bundlei < bp->numspec && memcmp(hash2.bytes,bp->speculative[bundlei].bytes,sizeof(hash2)) == 0 )
/*else if ( bp->speculative != 0 && bundlei < bp->numspec && memcmp(hash2.bytes,bp->speculative[bundlei].bytes,sizeof(hash2)) == 0 )
{
bundlei += offset;
if ( bundlei < bp->n && bundlei < bp->numspec && time(NULL) > bp->issued[bundlei]+30 )
@ -441,7 +441,7 @@ void iguana_bundlespeculate(struct iguana_info *coin,struct iguana_bundle *bp,in
iguana_blockQ("speculate",coin,0,-1,bp->speculative[bundlei],0);
bp->issued[bundlei] = (uint32_t)time(NULL);
}
} //else printf("speculative.%p %d vs %d cmp.%d\n",bp->speculative,bundlei,bp->numspec,bp->speculative!=0?memcmp(hash2.bytes,bp->speculative[bundlei].bytes,sizeof(hash2)):-1);*/
} */ //else printf("speculative.%p %d vs %d cmp.%d\n",bp->speculative,bundlei,bp->numspec,bp->speculative!=0?memcmp(hash2.bytes,bp->speculative[bundlei].bytes,sizeof(hash2)):-1);*/
}

Loading…
Cancel
Save