diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 19e3a4265..b76100e93 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -375,17 +375,17 @@ dividends(coin, height, )\n\ } else { + if ( base != 0 && rel != 0 && strcmp(method,"pricearray") == 0 ) + { + uint32_t firsttime; + if ( (firsttime= juint(argjson,"firsttime")) < time(NULL)-30*24*3600 ) + firsttime = (uint32_t)(time(NULL)-30*24*3600); + return(jprint(LP_pricearray(base,rel,firsttime,juint(argjson,"lasttime"),jint(argjson,"timescale")),1)); + } if ( IAMLP != 0 ) { if ( strcmp(method,"register") == 0 ) return(clonestr("{\"error\":\"you are running an obsolete version, update\"}")); - else if ( base != 0 && rel != 0 && strcmp(method,"pricearray") == 0 ) - { - uint32_t firsttime; - if ( (firsttime= juint(argjson,"firsttime")) < time(NULL)-30*24*3600 ) - firsttime = (uint32_t)(time(NULL)-30*24*3600); - return(jprint(LP_pricearray(base,rel,firsttime,juint(argjson,"lasttime"),jint(argjson,"timescale")),1)); - } else if ( strcmp(method,"lookup") == 0 ) return(clonestr("{\"error\":\"you are running an obsolete version, update\"}")); if ( strcmp(method,"broadcast") == 0 ) diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index 623b61dfc..8dd2c1ad7 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -65,6 +65,7 @@ //#define BASILISK_DISABLEWAITTX //#define BASILISK_DISABLESENDTX +#define LP_RPCPORT 7783 #define LP_PROPAGATION_SLACK 100 // txid ordering is not enforced, so getting extra recent txid #define LP_RESERVETIME 60 diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 8cfd07bdb..3a2589089 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -792,7 +792,7 @@ void LP_main(void *ptr) profitmargin = jdouble(argjson,"profitmargin"); LP_profitratio += profitmargin; if ( (port= juint(argjson,"rpcport")) < 1000 ) - port = 7779; + port = LP_RPCPORT; LPinit(port,7780,7781,7782,passphrase,jint(argjson,"client"),jstr(argjson,"userhome"),argjson); } } diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 3c98b48f5..2d5153695 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -561,7 +561,7 @@ void stats_rpcloop(void *args) socklen_t clilen; char helpname[512],remoteaddr[64],*buf,*retstr,*space; struct sockaddr_in cli_addr; uint32_t ipbits,i,size = 32*IGUANA_MAXPACKETSIZE + 512; if ( (port= *(uint16_t *)args) == 0 ) - port = 7779; + port = LP_RPCPORT; if ( jsonbuf == 0 ) jsonbuf = calloc(1,IGUANA_MAXPACKETSIZE); while ( (bindsock= iguana_socket(1,"0.0.0.0",port)) < 0 ) @@ -1022,7 +1022,7 @@ char *stats_update(FILE *logfp,char *destdir,char *statefname,char *komodofname) int main(int argc, const char * argv[]) { - struct tai T; uint32_t timestamp; struct DEXstats_disp prices[365]; int32_t i,n,seconds,leftdatenum; FILE *fp,*logfp; char *filestr,*retstr,*statefname,logfname[512],komodofile[512]; uint16_t port = 7779; + struct tai T; uint32_t timestamp; struct DEXstats_disp prices[365]; int32_t i,n,seconds,leftdatenum; FILE *fp,*logfp; char *filestr,*retstr,*statefname,logfname[512],komodofile[512]; uint16_t port = LP_RPCPORT; if ( argc < 2 ) { statefname = "/root/.komodo/KV/komodostate";