Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
5e3581a5cf
  1. 5
      iguana/iguana_bundles.c
  2. 8
      iguana/iguana_ramchain.c

5
iguana/iguana_bundles.c

@ -271,7 +271,7 @@ int32_t iguana_bundlehash2add(struct iguana_info *coin,struct iguana_block **blo
struct iguana_bundle *iguana_bundlecreate(struct iguana_info *coin,int32_t *bundleip,int32_t bundleheight,bits256 bundlehash2,bits256 allhash,int32_t issueflag)
{
char str[65]; struct iguana_bundle *bp = 0;
char str[65],dirname[1024]; struct iguana_bundle *bp = 0;
if ( bits256_nonz(bundlehash2) > 0 )
{
bits256_str(str,bundlehash2);
@ -298,7 +298,8 @@ struct iguana_bundle *iguana_bundlecreate(struct iguana_info *coin,int32_t *bund
coin->bundles[coin->bundlescount-1]->nextbp = bp;
*bundleip = 0;
bits256_str(str,bundlehash2);
fprintf(stderr,"{%d} ",bp->bundleheight);
sprintf(dirname,"tmp/%s/%d",coin->symbol,bp->bundleheight);
OS_ensure_directory(dirname);
//printf("ht.%d alloc.[%d] new hdrs.%s %s\n",bp->bundleheight,coin->bundlescount,str,bits256_str(str2,allhash));
iguana_bundlehash2add(coin,0,bp,0,bundlehash2);
if ( issueflag != 0 )

8
iguana/iguana_ramchain.c

@ -243,7 +243,11 @@ int32_t iguana_peerfname(struct iguana_info *coin,int32_t *hdrsip,char *dirname,
}
hash2 = bp->hashes[0], *hdrsip = bp->hdrsi;
if ( numblocks == 1 )
sprintf(fname,"%s/%s/%s.%u",dirname,coin->symbol,bits256_str(str,hash2),ipbits!=0?ipbits:*hdrsip);
{
if ( bits256_nonz(bp->hashes[bundlei]) != 0 )
sprintf(fname,"%s/%s/%d/%s.%u",dirname,coin->symbol,bp->bundleheight,bits256_str(str,bp->hashes[bundlei]),ipbits!=0?ipbits:*hdrsip);
else return(-3);
}
else sprintf(fname,"%s/%s/%s_%d.%u",dirname,coin->symbol,bits256_str(str,hash2),numblocks,ipbits!=0?ipbits:*hdrsip);
OS_compatible_path(fname);
return(bundlei);
@ -2707,7 +2711,7 @@ int32_t iguana_bundlesaveHT(struct iguana_info *coin,struct OS_memspace *mem,str
retval = 0;
} else bp->generrs++;
iguana_bundlemapfree(mem,&HASHMEM,ipbits,ptrs,filesizes,num,R,bp->n);
if ( retval == 0 || bp->generrs > 3 )
if ( retval == 0 )//|| bp->generrs > 3 )
{
//printf("delete %d files hdrs.%d retval.%d\n",num,bp->hdrsi,retval);
for (j=0; j<num; j++)

Loading…
Cancel
Save