Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
f69a7138a7
  1. 3
      iguana/iguana_bundles.c
  2. 6
      iguana/iguana_ramchain.c
  3. 2
      iguana/iguana_recv.c

3
iguana/iguana_bundles.c

@ -237,7 +237,7 @@ int32_t iguana_bundlehash2add(struct iguana_info *coin,struct iguana_block **blo
bp->blocks[bundlei] = block;
else if ( bp->blocks[bundlei] != block )
printf(">>>>>>>>>>>>>> bundlehash2.(%s) ht.(%d %d) block.%p there\n",bits256_str(str,hash2),bp->bundleheight,bundlei,bp->blocks[bundlei]);
otherbp = 0;
otherbp = 0, otherbundlei = -2;
if ( (otherbp= iguana_bundlefind(coin,&otherbp,&otherbundlei,hash2)) != 0 || (bundlei % (bundlesize-1)) == 0)
{
if ( bundlei == 0 && (otherbundlei == -2 || otherbundlei == bundlesize-1) )
@ -290,6 +290,7 @@ struct iguana_bundle *iguana_bundlecreate(struct iguana_info *coin,int32_t *bund
if ( bits256_nonz(bundlehash2) > 0 )
{
bits256_str(str,bundlehash2);
bp = 0, *bundleip = -2;
if ( iguana_bundlefind(coin,&bp,bundleip,bundlehash2) != 0 )
{
if ( bp->bundleheight >= 0 && bp->bundleheight != (bundleheight - *bundleip) )

6
iguana/iguana_ramchain.c

@ -90,13 +90,15 @@ void iguana_blocksetcounters(struct iguana_info *coin,struct iguana_block *block
int32_t iguana_peerfname(struct iguana_info *coin,int32_t *hdrsip,char *dirname,char *fname,uint32_t ipbits,bits256 hash2,bits256 prevhash2,int32_t numblocks,int32_t dispflag)
{
struct iguana_bundle *bp = 0; int32_t bundlei = -2; char str[65];
struct iguana_bundle *bp; int32_t bundlei; char str[65];
*hdrsip = -1; ipbits = 0;
fname[0] = 0;
//if ( ipbits == 0 )
// printf("illegal ipbits.%d\n",ipbits), getchar();
bp = 0, bundlei = -2;
if ( (bp= iguana_bundlefind(coin,&bp,&bundlei,hash2)) == 0 )
{
bp = 0, bundlei = -2;
if ( bits256_nonz(prevhash2) == 0 || (bp= iguana_bundlefind(coin,&bp,&bundlei,prevhash2)) == 0 || bundlei >= coin->chain->bundlesize-1 )
{
if ( dispflag != 0 )
@ -1684,8 +1686,10 @@ long iguana_ramchain_data(struct iguana_info *coin,struct iguana_peer *addr,stru
return(-1);
} //else printf("matched merkle.%d\n",txn_count);
} else printf("not enough memory for merkle verify %ld vs %lu\n",sizeof(bits256)*(txn_count+1),(long)addr->TXDATA.totalsize);
bp = 0, bundlei = -2;
if ( iguana_bundlefind(coin,&bp,&bundlei,origtxdata->block.RO.hash2) == 0 )
{
bp = 0, bundlei = -2;
if ( iguana_bundlefind(coin,&bp,&bundlei,origtxdata->block.RO.prev_block) == 0 )
{
origtxdata->block.RO.recvlen = 0;

2
iguana/iguana_recv.c

@ -67,6 +67,7 @@ int32_t iguana_sendblockreqPT(struct iguana_info *coin,struct iguana_peer *addr,
// if ( (rand() % 10 ) != 0 )
return(0);
}
checkbp = 0, j = -2;
if ( (checkbp= iguana_bundlefind(coin,&checkbp,&j,hash2)) != 0 && j >= 0 && j < checkbp->n )
{
if ( checkbp->emitfinish != 0 || ((block= checkbp->blocks[j]) != 0 && block->txvalid != 0) )
@ -596,6 +597,7 @@ struct iguana_bundle *iguana_bundleset(struct iguana_info *coin,struct iguana_bl
*blockp = block;
//if ( 0 && bits256_nonz(prevhash2) > 0 )
// iguana_patch(coin,block);
bp = 0, bundlei = -2;
if ( (bp= iguana_bundlefind(coin,&bp,&bundlei,hash2)) != 0 && bundlei < coin->chain->bundlesize )
{
//fprintf(stderr,"bundle found %d:%d\n",bp->hdrsi,bundlei);

Loading…
Cancel
Save