Hush Is A Fast State Of Life

This commit is contained in:
Duke Leto
2020-12-06 17:09:12 -05:00
parent 32322be455
commit 467c8c37e3
2 changed files with 4 additions and 4 deletions

View File

@@ -378,11 +378,11 @@ void komodo_stateupdate(int32_t height,uint8_t notarypubs[][33],uint8_t numnotar
komodo_statefname(fname,SMART_CHAIN_SYMBOL,(char *)"komodostate"); komodo_statefname(fname,SMART_CHAIN_SYMBOL,(char *)"komodostate");
if ( (fp= fopen(fname,"rb+")) != 0 ) if ( (fp= fopen(fname,"rb+")) != 0 )
{ {
if ( (retval= komodo_faststateinit(sp,fname,symbol,dest)) > 0 ) if ( (retval= hush_faststateinit(sp,fname,symbol,dest)) > 0 )
fseek(fp,0,SEEK_END); fseek(fp,0,SEEK_END);
else else
{ {
fprintf(stderr,"komodo_faststateinit retval.%d\n",retval); fprintf(stderr,"hush_faststateinit retval.%d\n",retval);
while ( komodo_parsestatefile(sp,fp,symbol,dest) >= 0 ) while ( komodo_parsestatefile(sp,fp,symbol,dest) >= 0 )
; ;
} }

View File

@@ -1357,7 +1357,7 @@ long komodo_indfile_update(FILE *indfp,uint32_t *prevpos100p,long lastfpos,long
return(newfpos); return(newfpos);
} }
int32_t komodo_faststateinit(struct komodo_state *sp,char *fname,char *symbol,char *dest) int32_t hush_faststateinit(struct komodo_state *sp,char *fname,char *symbol,char *dest)
{ {
FILE *indfp; char indfname[1024]; uint8_t *filedata; long validated=-1,datalen,fpos,lastfpos; uint32_t tmp,prevpos100,indcounter,starttime; int32_t func,finished = 0; FILE *indfp; char indfname[1024]; uint8_t *filedata; long validated=-1,datalen,fpos,lastfpos; uint32_t tmp,prevpos100,indcounter,starttime; int32_t func,finished = 0;
starttime = (uint32_t)time(NULL); starttime = (uint32_t)time(NULL);
@@ -1414,7 +1414,7 @@ int32_t komodo_faststateinit(struct komodo_state *sp,char *fname,char *symbol,ch
finished = 1; finished = 1;
} }
} }
} else printf("komodo_faststateinit unexpected case\n"); } else printf("hush_faststateinit unexpected case\n");
free(filedata); free(filedata);
return(finished == 1); return(finished == 1);
} }