Browse Source

Test

etomic
jl777 7 years ago
parent
commit
552833943d
  1. 4
      iguana/exchanges/LP_commands.c
  2. 4
      iguana/exchanges/LP_signatures.c
  3. 5
      iguana/exchanges/LP_stats.c

4
iguana/exchanges/LP_commands.c

@ -106,7 +106,7 @@ enable(coin)\n\
disable(coin)\n\
notarizations(coin)\n\
parselog()\n\
statsdisp()\n\
statsdisp(starttime=0, endtime=0)\n\
getrawtransaction(coin, txid)\n\
inventory(coin)\n\
bestfit(rel, relvolume)\n\
@ -220,7 +220,7 @@ stop()\n\
else if ( strcmp(method,"parselog") == 0 )
return(LP_statslog_parse());
else if ( strcmp(method,"statsdisp") == 0 )
return(LP_statslog_disp(0));
return(LP_statslog_disp(0,juint(argjson,"starttime"),juint(argjson,"endtime")));
else if ( strcmp(method,"secretaddresses") == 0 )
{
uint8_t taddr,pubtype;

4
iguana/exchanges/LP_signatures.c

@ -275,7 +275,7 @@ int32_t LP_utxos_sigcheck(uint32_t timestamp,char *sigstr,char *pubsecpstr,bits2
if ( ctx == 0 )
ctx = bitcoin_ctx();
pubp = LP_pubkeyfind(pubkey);
if ( pubp->numerrors < LP_MAXPUBKEY_ERRORS && sigstr != 0 && pubsecpstr != 0 && strlen(sigstr) == 65*2 && strlen(pubsecpstr) == 33 *2 )
if ( (pubp == 0|| pubp->numerrors < LP_MAXPUBKEY_ERRORS) && sigstr != 0 && pubsecpstr != 0 && strlen(sigstr) == 65*2 && strlen(pubsecpstr) == 33 *2 )
{
decode_hex(sig,65,sigstr);
decode_hex(pubsecp,33,pubsecpstr);
@ -288,7 +288,7 @@ int32_t LP_utxos_sigcheck(uint32_t timestamp,char *sigstr,char *pubsecpstr,bits2
{
if ( pubp != 0 )
pubp->numerrors++;
printf("LP_utxos_sigcheck failure, probably from %s with older version\n",bits256_str(str,pubkey));
printf("LP_utxos_sigcheck failure.%d, probably from %s with older version\n",pubp!=0?pubp->numerrors:-1,bits256_str(str,pubkey));
}
retval = -1;
} else retval = 0;

5
iguana/exchanges/LP_stats.c

@ -240,9 +240,11 @@ void LP_statslog_parseline(cJSON *lineobj)
} else printf("parseline no method.(%s)\n",jprint(lineobj,0));
}
char *LP_statslog_disp(int32_t n)
char *LP_statslog_disp(int32_t n,uint32_t starttime,uint32_t endtime)
{
cJSON *retjson,*array,*item; struct LP_swapstats *sp,*tmp; int32_t i; char line[1024]; uint64_t basevols[LP_MAXPRICEINFOS],relvols[LP_MAXPRICEINFOS];
if ( starttime > endtime )
starttime = endtime;
memset(basevols,0,sizeof(basevols));
memset(relvols,0,sizeof(relvols));
retjson = cJSON_CreateObject();
@ -251,6 +253,7 @@ char *LP_statslog_disp(int32_t n)
array = cJSON_CreateArray();
HASH_ITER(hh,LP_swapstats,sp,tmp)
{
if ( (starttime == 0 && endtime == 0) || (sp->Q.timestamp >= starttime && sp->Q.timestamp <= endtime) )
LP_swapstats_line(basevols,relvols,line,sp);
jaddistr(array,line);
}

Loading…
Cancel
Save