test
This commit is contained in:
@@ -573,14 +573,14 @@ void komodo_passport_iteration()
|
|||||||
//printf("PASSPORT %s refid.%d\n",ASSETCHAINS_SYMBOL,refid);
|
//printf("PASSPORT %s refid.%d\n",ASSETCHAINS_SYMBOL,refid);
|
||||||
for (baseid=0; baseid<=32; baseid++)
|
for (baseid=0; baseid<=32; baseid++)
|
||||||
{
|
{
|
||||||
|
sp = 0;
|
||||||
|
isrealtime = 0;
|
||||||
if ( baseid+1 != refid )
|
if ( baseid+1 != refid )
|
||||||
{
|
{
|
||||||
base = (char *)CURRENCIES[baseid];
|
base = (char *)CURRENCIES[baseid];
|
||||||
komodo_statefname(fname,baseid<32?base:(char *)"",(char *)"komodostate");
|
komodo_statefname(fname,baseid<32?base:(char *)"",(char *)"komodostate");
|
||||||
komodo_nameset(symbol,dest,base);
|
komodo_nameset(symbol,dest,base);
|
||||||
port = komodo_port(base,10,&magic) + 1;
|
port = komodo_port(base,10,&magic) + 1;
|
||||||
sp = 0;
|
|
||||||
isrealtime = 0;
|
|
||||||
if ( (fp= fopen(fname,"rb")) != 0 && (sp= komodo_stateptrget(symbol)) != 0 )
|
if ( (fp= fopen(fname,"rb")) != 0 && (sp= komodo_stateptrget(symbol)) != 0 )
|
||||||
{
|
{
|
||||||
//printf("refid.%d %s fname.(%s) base.%s\n",refid,symbol,fname,base);
|
//printf("refid.%d %s fname.(%s) base.%s\n",refid,symbol,fname,base);
|
||||||
@@ -594,27 +594,27 @@ void komodo_passport_iteration()
|
|||||||
//printf("from.(%s) lastpos[%s] %ld\n",ASSETCHAINS_SYMBOL,CURRENCIES[baseid],lastpos[baseid]);
|
//printf("from.(%s) lastpos[%s] %ld\n",ASSETCHAINS_SYMBOL,CURRENCIES[baseid],lastpos[baseid]);
|
||||||
} //else fprintf(stderr,"%s.%ld ",CURRENCIES[baseid],ftell(fp));
|
} //else fprintf(stderr,"%s.%ld ",CURRENCIES[baseid],ftell(fp));
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
if ( (retstr= komodo_issuemethod(userpass[baseid],(char *)"getinfo",0,port)) != 0 )
|
}
|
||||||
|
}
|
||||||
|
if ( (retstr= komodo_issuemethod(userpass[baseid],(char *)"getinfo",0,port)) != 0 )
|
||||||
|
{
|
||||||
|
if ( (infoobj= cJSON_Parse(retstr)) != 0 )
|
||||||
|
{
|
||||||
|
if ( (result= jobj(infoobj,(char *)"result")) != 0 )
|
||||||
{
|
{
|
||||||
if ( (infoobj= cJSON_Parse(retstr)) != 0 )
|
blocks = juint(result,(char *)"blocks");
|
||||||
{
|
longest = juint(result,(char *)"longestchain");
|
||||||
if ( (result= jobj(infoobj,(char *)"result")) != 0 )
|
printf("%s.(%d L%d) ",base,blocks,longest);
|
||||||
{
|
if ( blocks > 0 && blocks == longest )
|
||||||
blocks = juint(infoobj,(char *)"blocks");
|
isrealtime = 1;
|
||||||
longest = juint(infoobj,(char *)"longestchain");
|
}
|
||||||
printf("%s.(%d L%d) ",base,blocks,longest);
|
free_json(infoobj);
|
||||||
if ( blocks > 0 && blocks == longest )
|
}
|
||||||
isrealtime = 1;
|
//printf("(%s)\n",retstr);
|
||||||
}
|
free(retstr);
|
||||||
free_json(infoobj);
|
} else printf("%s port.%u no getinfo\n",base,port);
|
||||||
}
|
if ( sp != 0 )
|
||||||
//printf("(%s)\n",retstr);
|
sp->KOMODO_REALTIME = isrealtime * (uint32_t)time(NULL);
|
||||||
free(retstr);
|
|
||||||
} else printf("%s port.%u no getinfo\n",base,port);
|
|
||||||
} else printf("fname.(%s) cant open\n",fname);
|
|
||||||
if ( sp != 0 )
|
|
||||||
sp->KOMODO_REALTIME = isrealtime * (uint32_t)time(NULL);
|
|
||||||
} // else use direct data for self via connect
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user