Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
d155a78040
  1. 11
      iguana/iguana_ramchain.c
  2. 2
      iguana/iguana_recv.c

11
iguana/iguana_ramchain.c

@ -1306,7 +1306,7 @@ int32_t iguana_Xspendmap(struct iguana_info *coin,struct iguana_ramchain *ramcha
munmap(ptr,filesize);
ramchain->Xspendinds = 0;
}
}
} else printf("no Xspendfile\n");
} else printf("couldnt open.(%s)\n",fname);
return(ramchain->numXspends);
}
@ -2084,7 +2084,7 @@ struct iguana_ramchain *iguana_bundleload(struct iguana_info *coin,struct iguana
if ( (mapchain= iguana_ramchain_map(coin,fname,bp,bp->n,&bp->ramchain,0,0,bp->hashes[0],zero,0,0,0,1)) != 0 )
{
iguana_ramchain_link(mapchain,bp->hashes[0],bp->ramchain.lasthash2,bp->hdrsi,bp->bundleheight,0,bp->ramchain.numblocks,firsti,1);
//char str[65]; printf("bp.%d: T.%d U.%d S.%d P%d X.%d MAPPED %s %p\n",bp->hdrsi,bp->ramchain.H.data->numtxids,bp->ramchain.H.data->numunspents,bp->ramchain.H.data->numspends,bp->ramchain.H.data->numpkinds,bp->ramchain.H.data->numexternaltxids,mbstr(str,bp->ramchain.H.data->allocsize),bp->ramchain.H.data);
char str[65]; printf("bp.%d: T.%d U.%d S.%d P%d X.%d MAPPED %s %p\n",bp->hdrsi,bp->ramchain.H.data->numtxids,bp->ramchain.H.data->numunspents,bp->ramchain.H.data->numspends,bp->ramchain.H.data->numpkinds,bp->ramchain.H.data->numexternaltxids,mbstr(str,bp->ramchain.H.data->allocsize),bp->ramchain.H.data);
//ramcoder_test(bp->ramchain.H.data,bp->ramchain.H.data->allocsize);
B = (void *)(long)((long)mapchain->H.data + mapchain->H.data->Boffset);
T = (void *)(long)((long)mapchain->H.data + mapchain->H.data->Toffset);
@ -2110,7 +2110,7 @@ struct iguana_ramchain *iguana_bundleload(struct iguana_info *coin,struct iguana
}
}
}
//printf("bundle.%d\n",bp->bundleheight);
printf("mapped bundle.%d\n",bp->bundleheight);
bp->emitfinish = (uint32_t)time(NULL) + 1;
/*for (i=1; i<mapchain->H.data->numtxids; i++)
{break;
@ -2120,6 +2120,11 @@ struct iguana_ramchain *iguana_bundleload(struct iguana_info *coin,struct iguana
printf("compare error T[%d] %s\n",i,bits256_str(str,T[i].txid));
}*/
}
else
{
printf("couldnt load bundle.%d\n",bp->bundleheight);
memset(&bp->ramchain,0,sizeof(bp->ramchain));
}
if ( mapchain != 0 )
coin->newramchain++;
return(mapchain);

2
iguana/iguana_recv.c

@ -1351,7 +1351,7 @@ int32_t iguana_reqblocks(struct iguana_info *coin)
iguana_blockQ(coin,bp,bundlei,bp->hashes[bundlei],0);
flag++;
char str[65];
if ( 1 && (rand() % 1000) == 0 || bp == coin->current )
if ( 1 && (rand() % 1000) == 0 || bp->bundleheight > coin->longestchain-coin->chain->bundlesize )
printf("%s MAINCHAIN.%d threshold %.3f %.3f lag %.3f\n",bits256_str(str,hash2),coin->blocks.hwmchain.height+1,threshold,coin->backstopmillis,lag);
}
else if ( bp != 0 && bundlei < bp->n-1 && bits256_nonz(bp->hashes[bundlei+1]) > 0 )

Loading…
Cancel
Save