Browse Source

test

release/v0.1
jl777 8 years ago
parent
commit
a31bf1d953
  1. 3
      iguana/iguana777.c
  2. 3
      iguana/iguana_init.c
  3. 12
      iguana/iguana_spendvectors.c

3
iguana/iguana777.c

@ -243,7 +243,8 @@ uint32_t iguana_updatemetrics(struct supernet_info *myinfo,struct iguana_info *c
printf("new peers.txt %ld vs (%s) %ld (%s)\n",ftell(fp),fname,(long)OS_filesize(fname),GLOBAL_CONFSDIR); printf("new peers.txt %ld vs (%s) %ld (%s)\n",ftell(fp),fname,(long)OS_filesize(fname),GLOBAL_CONFSDIR);
fclose(fp); fclose(fp);
OS_renamefile(fname,oldfname); OS_renamefile(fname,oldfname);
OS_copyfile(tmpfname,fname,1); OS_renamefile(tmpfname,fname);
//OS_copyfile(tmpfname,fname,1);
} else fclose(fp); } else fclose(fp);
} }
else else

3
iguana/iguana_init.c

@ -194,7 +194,8 @@ int32_t iguana_savehdrs(struct iguana_info *coin)
printf("new hdrs.txt %ld vs (%s) %ld\n",ftell(fp),fname,(long)OS_filesize(fname)); printf("new hdrs.txt %ld vs (%s) %ld\n",ftell(fp),fname,(long)OS_filesize(fname));
fclose(fp); fclose(fp);
OS_renamefile(fname,oldfname); OS_renamefile(fname,oldfname);
OS_copyfile(tmpfname,fname,1); OS_renamefile(tmpfname,fname);
//OS_copyfile(tmpfname,fname,1);
} else fclose(fp); } else fclose(fp);
if ( fp2 != 0 ) if ( fp2 != 0 )
{ {

12
iguana/iguana_spendvectors.c

@ -888,17 +888,21 @@ int32_t iguana_balanceflush(struct supernet_info *myinfo,struct iguana_info *coi
else if ( iter == 2 ) else if ( iter == 2 )
{ {
sprintf(destfname,"%s/%s/accounts/debits.%d",GLOBAL_DBDIR,coin->symbol,bp->bundleheight); sprintf(destfname,"%s/%s/accounts/debits.%d",GLOBAL_DBDIR,coin->symbol,bp->bundleheight);
if ( OS_copyfile(fname,destfname,1) < 0 ) OS_removefile(destfname,0);
OS_renamefile(fname,destfname);
/*if ( OS_copyfile(fname,destfname,1) < 0 )
{ {
printf("balances error copying (%s) -> (%s)\n",fname,destfname); printf("balances error copying (%s) -> (%s)\n",fname,destfname);
return(-1); return(-1);
} }*/
sprintf(destfname,"%s/%s/accounts/lastspends.%d",GLOBAL_DBDIR,coin->symbol,bp->bundleheight); sprintf(destfname,"%s/%s/accounts/lastspends.%d",GLOBAL_DBDIR,coin->symbol,bp->bundleheight);
if ( OS_copyfile(fname2,destfname,1) < 0 ) OS_removefile(destfname,0);
OS_renamefile(fname2,destfname);
/*if ( OS_copyfile(fname2,destfname,1) < 0 )
{ {
printf("balances error copying (%s) -> (%s)\n",fname2,destfname); printf("balances error copying (%s) -> (%s)\n",fname2,destfname);
return(-1); return(-1);
} }*/
if ( (hdrsi % 100) == 0 ) if ( (hdrsi % 100) == 0 )
printf("%s -> %s\n",fname,destfname); printf("%s -> %s\n",fname,destfname);
OS_removefile(fname,0); OS_removefile(fname,0);

Loading…
Cancel
Save