Browse Source

Merge pull request #402 from jl777/spvdex

guistats and pubkeystats
etomic
jl777 7 years ago
committed by GitHub
parent
commit
b8d4b1a1e3
  1. 7
      iguana/exchanges/LP_commands.c
  2. 11
      iguana/exchanges/LP_stats.c
  3. 3
      iguana/exchanges/guistats
  4. 2
      iguana/exchanges/install
  5. 3
      iguana/exchanges/pubkeystats

7
iguana/exchanges/LP_commands.c

@ -222,13 +222,14 @@ stop()\n\
}
else if ( strcmp(method,"parselog") == 0 )
{
int32_t n = LP_statslog_parse();
return(LP_statslog_disp(n,2000000000,2000000000));
bits256 zero; int32_t n = LP_statslog_parse();
memset(zero.bytes,0,sizeof(zero));
return(LP_statslog_disp(n,2000000000,2000000000,"",zero));
}
else if ( strcmp(method,"statsdisp") == 0 )
{
int32_t n = LP_statslog_parse();
return(LP_statslog_disp(n,juint(argjson,"starttime"),juint(argjson,"endtime")));
return(LP_statslog_disp(n,juint(argjson,"starttime"),juint(argjson,"endtime"),jstr(argjson,"gui"),jbits256(argjson,"pubkey")));
}
else if ( strcmp(method,"secretaddresses") == 0 )
{

11
iguana/exchanges/LP_stats.c

@ -321,7 +321,7 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj)
return(duplicate == 0);
}
char *LP_statslog_disp(int32_t n,uint32_t starttime,uint32_t endtime)
char *LP_statslog_disp(int32_t n,uint32_t starttime,uint32_t endtime,char *refgui,bits256 refpubkey)
{
cJSON *retjson,*array,*item; struct LP_swapstats *sp,*tmp; int32_t i,dispflag,numtrades[LP_MAXPRICEINFOS]; char line[1024]; uint64_t basevols[LP_MAXPRICEINFOS],relvols[LP_MAXPRICEINFOS];
if ( starttime > endtime )
@ -345,6 +345,15 @@ char *LP_statslog_disp(int32_t n,uint32_t starttime,uint32_t endtime)
else if ( sp->Q.timestamp >= starttime && sp->Q.timestamp <= endtime )
dispflag = 1;
if ( dispflag != 0 )
{
dispflag = 0;
if ( refgui == 0 || refgui[0] == 0 || strcmp(refgui,sp->bobgui) == 0 || strcmp(refgui,sp->alicegui) == 0 )
{
if ( bits256_nonz(refpubkey) == 0 || bits256_cmp(refpubkey,sp->Q.srchash) == 0 || bits256_cmp(refpubkey,sp->Q.desthash) == 0 )
dispflag = 1;
}
}
if ( dispflag != 0 )
{
LP_swapstats_line(numtrades,basevols,relvols,line,sp);
item = cJSON_CreateObject();

3
iguana/exchanges/guistats

@ -0,0 +1,3 @@
#!/bin/bash
source userpass
curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"statsdisp\",\"starttime\":0,\"endtime\":0,\"gui\":\"buildog\"}"

2
iguana/exchanges/install

@ -1,5 +1,5 @@
#!/bin/bash
cp pendings coinswaps baserelswaps setpassphrase notarizations getrawtransaction parselog statsdisp m_js trust trusted setconfirms balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices help inv setprice status ../dexscripts
cp guistats pubkeystats pendings coinswaps baserelswaps setpassphrase notarizations getrawtransaction parselog statsdisp m_js trust trusted setconfirms balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices help inv setprice status ../dexscripts
cp coins.json ..
cd ../dexscripts
#cp ../exchanges/passphrase ../exchanges/userpass .

3
iguana/exchanges/pubkeystats

@ -0,0 +1,3 @@
#!/bin/bash
source userpass
curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"statsdisp\",\"starttime\":0,\"endtime\":0,\"pubkey\":\"a2593155464e37fcc88245780240a412a38cf3d316809445aad73f4e7789187d\"}"
Loading…
Cancel
Save