Browse Source

test

etomic
jl777 7 years ago
parent
commit
2064dbfd1c
  1. 2
      iguana/exchanges/LP_scan.c
  2. 11
      iguana/exchanges/balance_loop
  3. 9
      iguana/exchanges/snapshot_loop

2
iguana/exchanges/LP_scan.c

@ -278,6 +278,8 @@ int sort_balance(void *a,void *b)
return((aval == bval) ? 0 : ((aval < bval) ? 1 : -1));
}
// a primitive restore can be done by loading the previous snapshot and creating a virtual tx for all the balance at height-1. this wont allow anything but new snapshots, but for many use cases that is all that is needed
cJSON *LP_snapshot(struct iguana_info *coin,int32_t height)
{
static char lastcoin[16]; static int32_t maxsnapht;

11
iguana/exchanges/balance_loop

@ -0,0 +1,11 @@
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\":\"snapshot\",\"coin\":\"KMD\"}" | jq .blocks`
echo next height $ht
sleep 600
done

9
iguana/exchanges/snapshot_loop

@ -2,9 +2,10 @@ 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=$(( $ht + 100 ))
echo next hight $ht
sleep 6000
#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\":\"snapshot\",\"coin\":\"KMD\"}" | jq .blocks`
echo next height $ht
sleep 600
done

Loading…
Cancel
Save