This commit is contained in:
jl777
2016-11-19 14:40:06 -03:00
parent 2d116f0188
commit 52f1d7888b

View File

@@ -565,31 +565,28 @@ void komodo_passport_iteration()
refid = 32; refid = 32;
else refid = komodo_baseid(ASSETCHAINS_SYMBOL); else refid = komodo_baseid(ASSETCHAINS_SYMBOL);
//printf("PASSPORT %s refid.%d\n",ASSETCHAINS_SYMBOL,refid); //printf("PASSPORT %s refid.%d\n",ASSETCHAINS_SYMBOL,refid);
if ( refid >= 0 ) for (baseid=0; baseid<=32; baseid++)
{ {
for (baseid=0; baseid<=32; baseid++) if ( baseid != refid )
{ {
if ( baseid != refid ) // use direct data for yourself base = (char *)CURRENCIES[baseid];
komodo_statefname(fname,baseid<32?base:(char *)"");
komodo_nameset(symbol,dest,base);
if ( (fp= fopen(fname,"rb")) != 0 && (sp= komodo_stateptrget(symbol)) != 0 )
{ {
base = (char *)CURRENCIES[baseid]; fseek(fp,0,SEEK_END);
komodo_statefname(fname,baseid<32?base:(char *)""); if ( ftell(fp) > lastpos[baseid] )
komodo_nameset(symbol,dest,base);
if ( (fp= fopen(fname,"rb")) != 0 && (sp= komodo_stateptrget(symbol)) != 0 )
{ {
fseek(fp,0,SEEK_END); fseek(fp,lastpos[baseid],SEEK_SET);
if ( ftell(fp) > lastpos[baseid] ) while ( komodo_parsestatefile(sp,fp,symbol,dest) >= 0 )
{ ;
fseek(fp,lastpos[baseid],SEEK_SET); lastpos[baseid] = ftell(fp);
while ( komodo_parsestatefile(sp,fp,symbol,dest) >= 0 ) printf("%s lastpos[%s] %ld\n",ASSETCHAINS_SYMBOL,CURRENCIES[baseid],lastpos[baseid]);
; } //else fprintf(stderr,"%s.%ld ",CURRENCIES[baseid],ftell(fp));
lastpos[baseid] = ftell(fp); fclose(fp);
printf("%s lastpos[%s] %ld\n",ASSETCHAINS_SYMBOL,CURRENCIES[baseid],lastpos[baseid]); } else printf("fname.(%s) cant open\n",fname);
} //else fprintf(stderr,"%s.%ld ",CURRENCIES[baseid],ftell(fp)); } // else use direct data for self via connect
fclose(fp); }
} else printf("fname.(%s) cant open\n",fname);
}
}
} else printf("passport disabled for refid.%d (%s)\n",refid,ASSETCHAINS_SYMBOL);
} }
#endif #endif