Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
0873708e11
  1. 7
      iguana/iguana_bundles.c
  2. 21
      iguana/iguana_recv.c

7
iguana/iguana_bundles.c

@ -1191,8 +1191,11 @@ void iguana_bundlestats(struct iguana_info *coin,char *str)
} }
hash2 = block->RO.hash2; hash2 = block->RO.hash2;
} }
if ( i == bp->n ) if ( i == bp->n && iguana_bundlefinalize(coin,bp,&coin->MEM,coin->MEMB) == 0 )
iguana_bundlefinalize(coin,bp,&coin->MEM,coin->MEMB); {
//free(bp->speculative);
//bp->speculative = 0;
}
} }
/*if ( bp->speculative != 0 && missing == 0 ) /*if ( bp->speculative != 0 && missing == 0 )
{ {

21
iguana/iguana_recv.c

@ -1238,6 +1238,25 @@ int32_t iguana_reqhdrs(struct iguana_info *coin)
return(n); return(n);
} }
int32_t iguana_speculativesearch(struct iguana_info *coin,bits256 hash2)
{
int32_t i,j; struct iguana_bundle *bp;
for (i=0; i<coin->bundlescount; i++)
{
if ( (bp= coin->bundles[i]) != 0 && bp->speculative != 0 )
{
for (j=0; j<bp->n&&j<bp->numspec; j++)
if ( bits256_cmp(hash2,bp->speculative[j]) == 0 )
{
if ( bp->speculativecache[j] != 0 )
return(1);
else return(-1);
}
}
}
return(0);
}
int32_t iguana_blockQ(char *argstr,struct iguana_info *coin,struct iguana_bundle *bp,int32_t bundlei,bits256 hash2,int32_t priority) int32_t iguana_blockQ(char *argstr,struct iguana_info *coin,struct iguana_bundle *bp,int32_t bundlei,bits256 hash2,int32_t priority)
{ {
queue_t *Q; char *str; int32_t n,height = -1; struct iguana_blockreq *req; struct iguana_block *block = 0; queue_t *Q; char *str; int32_t n,height = -1; struct iguana_blockreq *req; struct iguana_block *block = 0;
@ -1247,6 +1266,8 @@ int32_t iguana_blockQ(char *argstr,struct iguana_info *coin,struct iguana_bundle
//getchar(); //getchar();
return(-1); return(-1);
} }
if ( coin->enableCACHE != 0 || iguana_speculativesearch(coin,hash2) > 0 )
return(0);
block = iguana_blockfind(coin,hash2); block = iguana_blockfind(coin,hash2);
if ( priority != 0 || block == 0 || iguana_blockstatus(coin,block) == 0 ) if ( priority != 0 || block == 0 || iguana_blockstatus(coin,block) == 0 )
{ {

Loading…
Cancel
Save