Browse Source

Test

etomic
jl777 8 years ago
parent
commit
a4d1d6a88e
  1. 4
      iguana/exchanges/LP_scan.c
  2. 6
      iguana/exchanges/snapshot_loop

4
iguana/exchanges/LP_scan.c

@ -374,11 +374,12 @@ cJSON *LP_snapshot(struct iguana_info *coin,int32_t height)
char *LP_snapshot_balance(struct iguana_info *coin,int32_t height,cJSON *argjson)
{
cJSON *snapjson,*retjson,*balances,*array,*addrs,*child,*item,*item2; char *coinaddr,*refaddr; int32_t i,n,j,m; uint64_t value,balance = 0;
cJSON *snapjson,*retjson,*balances,*array,*addrs,*child,*item,*item2; char *coinaddr,*refaddr; int32_t i,n,j,m; uint64_t total=0,value,balance = 0;
retjson = cJSON_CreateObject();
array = cJSON_CreateArray();
if ( (snapjson= LP_snapshot(coin,height)) != 0 )
{
total = jdouble(snapjson,"total");
if ( (addrs= jarray(&m,argjson,"addresses")) != 0 )
{
if ( (balances= jarray(&n,snapjson,"balances")) != 0 )
@ -417,6 +418,7 @@ char *LP_snapshot_balance(struct iguana_info *coin,int32_t height,cJSON *argjson
jaddstr(retjson,"coin",coin->symbol);
jaddnum(retjson,"height",height);
jaddnum(retjson,"balance",dstr(balance));
jaddnum(retjson,"total",dstr(total));
return(jprint(retjson,1));
}

6
iguana/exchanges/snapshot_loop

@ -2,9 +2,9 @@ source userpass
ht=$1
while true
do
#curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\",\"height\":$ht}"
#ht=`curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"getinfo\",\"coin\":\"KMD\"}" | jq .blocks`
ht=$(( $ht + 100 ))
curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"method\":\"snapshot\",\"coin\":\"KMD\",\"height\":$ht}"
#ht=`komodo-cli getinfo | jq .blocks`
ht=$(( $ht + 1000 ))
echo next height $ht
sleep 1
done

Loading…
Cancel
Save