Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
95ef9b3a1e
  1. 3
      iguana/iguana777.c
  2. 2
      iguana/iguana_ramchain.c
  3. 2
      iguana/iguana_unspents.c

3
iguana/iguana777.c

@ -404,6 +404,7 @@ void iguana_coinflush(struct iguana_info *coin)
{
sprintf(fname,"accounts/%s/debits.%d",coin->symbol,bp->bundleheight);
sprintf(fname2,"accounts/%s/lastspends.%d",coin->symbol,bp->bundleheight);
printf("save (%s) and (%s), numpkinds.%d numunspentinds.%d\n",fname,fname2,bp->ramchain.H.data->numpkinds,bp->ramchain.H.data->numunspents);
if ( (fp= fopen(fname,"wb")) != 0 && (fp2= fopen(fname2,"wb")) != 0 )
{
if ( fwrite(bp->ramchain.A,sizeof(*bp->ramchain.A),bp->ramchain.H.data->numpkinds,fp) == bp->ramchain.H.data->numpkinds )
@ -532,7 +533,7 @@ struct iguana_info *iguana_setcoin(char *symbol,void *launched,int32_t maxpeers,
coin->myservices = services;
sprintf(dirname,"accounts/%s",symbol), OS_ensure_directory(dirname);
sprintf(dirname,"DB/%s",symbol), OS_ensure_directory(dirname);
sprintf(dirname,"DB/%s/utxo",symbol), OS_ensure_directory(dirname);
sprintf(dirname,"DB/%s/spends",symbol), OS_ensure_directory(dirname);
sprintf(dirname,"DB/%s/vouts",symbol), OS_ensure_directory(dirname);
sprintf(dirname,"purgeable/%s",symbol), OS_ensure_directory(dirname);
sprintf(dirname,"%s/%s",GLOBALTMPDIR,symbol), OS_ensure_directory(dirname);

2
iguana/iguana_ramchain.c

@ -1332,7 +1332,7 @@ void iguana_ramchain_extras(struct iguana_info *coin,struct iguana_ramchain *ram
int32_t iguana_Xspendmap(struct iguana_info *coin,struct iguana_ramchain *ramchain,struct iguana_bundle *bp)
{
int32_t hdrsi; bits256 sha256; char fname[1024],dirname[128]; void *ptr; long filesize; static bits256 zero;
sprintf(dirname,"DB/%s/utxo",coin->symbol);
sprintf(dirname,"DB/%s/spends",coin->symbol);
if ( iguana_peerfname(coin,&hdrsi,dirname,fname,0,bp->hashes[0],zero,bp->n) >= 0 )
{
if ( (ptr= OS_mapfile(fname,&filesize,0)) != 0 )

2
iguana/iguana_unspents.c

@ -294,7 +294,7 @@ int32_t iguana_utxogen(struct iguana_info *coin,struct iguana_bundle *bp)
{
emitted += emit;
memset(zero.bytes,0,sizeof(zero));
sprintf(dirname,"DB/%s/utxo",coin->symbol);
sprintf(dirname,"DB/%s/spends",coin->symbol);
vcalc_sha256(0,sha256.bytes,(void *)ptr,(int32_t)(sizeof(*ptr) * emit));
if ( iguana_peerfname(coin,&hdrsi,dirname,fname,0,bp->hashes[0],zero,bp->n) >= 0 )
{

Loading…
Cancel
Save