Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
a1614a300d
  1. 2
      iguana/iguana777.h
  2. 2
      iguana/iguana_bundles.c
  3. 28
      iguana/iguana_recv.c

2
iguana/iguana777.h

@ -43,7 +43,7 @@ typedef int32_t (*blockhashfunc)(uint8_t *blockhashp,uint8_t *serialized,int32_t
#define IGUANA_TAILPERCENTAGE 1.0 #define IGUANA_TAILPERCENTAGE 1.0
#define IGUANA_MAXPENDHDRS 1 #define IGUANA_MAXPENDHDRS 1
#define IGUANA_MAXPENDINGREQUESTS 2 #define IGUANA_MAXPENDINGREQUESTS 2
#define IGUANA_PENDINGREQUESTS 512 #define IGUANA_PENDINGREQUESTS 32
#define IGUANA_MINPENDBUNDLES 2 #define IGUANA_MINPENDBUNDLES 2
#define IGUANA_MAXPENDBUNDLES 128 #define IGUANA_MAXPENDBUNDLES 128
#define IGUANA_BUNDLELOOP 77 #define IGUANA_BUNDLELOOP 77

2
iguana/iguana_bundles.c

@ -459,7 +459,7 @@ int32_t iguana_blocksmissing(struct iguana_info *coin,int32_t *nonzp,uint8_t mis
} }
if ( bits256_nonz(hash2) != 0 ) if ( bits256_nonz(hash2) != 0 )
{ {
if ( bp->issued[i] == 0 ) if ( 0 && bp->issued[i] == 0 )
iguana_blockQ("missing",coin,bp,i,hash2,0); iguana_blockQ("missing",coin,bp,i,hash2,0);
if ( now > bp->issued[i]+lag ) if ( now > bp->issued[i]+lag )
{ {

28
iguana/iguana_recv.c

@ -633,23 +633,27 @@ struct iguana_bundle *iguana_bundleset(struct iguana_info *coin,struct iguana_bl
block->bundlei = bundlei; block->bundlei = bundlei;
block->hdrsi = bp->hdrsi; block->hdrsi = bp->hdrsi;
bp->blocks[bundlei] = block; bp->blocks[bundlei] = block;
if ( bits256_nonz(bp->hashes[bundlei]) == 0 && bp->emitfinish == 0 ) iguana_bundlehash2add(coin,0,bp,bundlei,hash2);
if ( bp->emitfinish == 0 )
{ {
block->fpos = -1; if ( bits256_nonz(bp->hashes[bundlei]) != 0 )
checki = iguana_peerfname(coin,&hdrsi,GLOBALTMPDIR,fname,0,bp->hashes[bundlei],bundlei>0?bp->hashes[bundlei-1]:zero,1,0);
if ( (fp= fopen(fname,"rb")) != 0 )
{ {
fseek(fp,0,SEEK_END); block->fpos = -1;
block->RO.recvlen = (uint32_t)ftell(fp); checki = iguana_peerfname(coin,&hdrsi,GLOBALTMPDIR,fname,0,bp->hashes[bundlei],bundlei>0?bp->hashes[bundlei-1]:zero,1,0);
block->fpipbits = 1; if ( (fp= fopen(fname,"rb")) != 0 )
block->txvalid = 1; {
block->fpos = 0; fseek(fp,0,SEEK_END);
printf("initialize with fp.[%d:%d] len.%d\n",hdrsi,bundlei,block->RO.recvlen); block->RO.recvlen = (uint32_t)ftell(fp);
fclose(fp); block->fpipbits = 1;
block->txvalid = 1;
block->fpos = 0;
//printf("initialize with fp.[%d:%d] len.%d\n",hdrsi,bundlei,block->RO.recvlen);
fclose(fp);
}
} }
else iguana_blockQ("bundleset",coin,bp,bundlei,block->RO.hash2,0);
} }
//printf("bundlehashadd set.%d\n",bundlei); //printf("bundlehashadd set.%d\n",bundlei);
iguana_bundlehash2add(coin,0,bp,bundlei,hash2);
if ( bundlei > 0 ) if ( bundlei > 0 )
{ {
//printf("bundlehashadd prev %d\n",bundlei); //printf("bundlehashadd prev %d\n",bundlei);

Loading…
Cancel
Save