forked from axiom-team/g1-stats
fix bad walletUp loop
This commit is contained in:
parent
254b883b4f
commit
c444c3035e
12
g1-stats.sh
12
g1-stats.sh
|
@ -22,8 +22,6 @@ echo "Initialisation ..."
|
|||
outFile="/tmp/g1-stats-$day-$startTime_$id"
|
||||
TXBLOCKS=$(cat $SCRIPTPATH/db/txblocs)
|
||||
#TXBLOCKS=$(curl -s ${DUNITER}/blockchain/with/tx | jq '.result.blocks[]')
|
||||
#TXBLOCKS+=$(curl -s ${DUNITER2}/blockchain/with/tx | jq '.result.blocks[]')
|
||||
#TXBLOCKS+=$(curl -s ${DUNITER3}/blockchain/with/tx | jq '.result.blocks[]')
|
||||
TXBLOCKS=($(echo "$TXBLOCKS" | sort -hu | awk '{printf $1" "}'))
|
||||
unset 'TXBLOCKS[${#TXBLOCKS[@]}-1]'
|
||||
MEMBERS=$(curl -s ${DUNITER}/wot/members | jq -r '.results[].pubkey')
|
||||
|
@ -36,16 +34,16 @@ isWeb=$1
|
|||
echo "[" > $SCRIPTPATH/db/recus.json
|
||||
loopWalletUp() {
|
||||
for i in ${TXBLOCKS[*]}; do
|
||||
[[ -z ${TXBLOCKS[$i]} ]] && break
|
||||
sleep 0.1
|
||||
WALLETS0=$(curl -s ${DUNITER}/blockchain/block/${TXBLOCKS[$i]})
|
||||
[[ -z $i ]] && break
|
||||
sleep 0.05
|
||||
WALLETS0=$(curl -s ${DUNITER}/blockchain/block/$i)
|
||||
until WALLETS=$(echo $WALLETS0 | jq -r '.medianTime,(.transactions[] | select(.issuers[0] as $issuers | .outputs[0]|contains($issuers)|not) | .outputs[0])' 2>/dev/null); do
|
||||
[[ $isWeb != "web" ]] && echo -e "iter $iter \n$WALLETS0"
|
||||
sleep 2
|
||||
WALLETS0=$(curl -s ${DUNITER}/blockchain/block/${TXBLOCKS[$i]})
|
||||
WALLETS0=$(curl -s ${DUNITER}/blockchain/block/$i)
|
||||
done
|
||||
[[ -z "$WALLETS" ]] && continue
|
||||
bloc=${TXBLOCKS[$i]}
|
||||
bloc=$i
|
||||
|
||||
# Récupération de la date du block
|
||||
blockDate=$(echo "$WALLETS" | head -n1)
|
||||
|
|
|
@ -1 +1 @@
|
|||
{\n \"date\": \"_DATE\",\n \"rWallets\": \"_RWALLETS\",\n \"rMembres\": \"_RMEMBRES\"\n },
|
||||
{\n \"date\": \"_DATE\",\n \"rWallets\": _RWALLETS,\n \"rMembres\": _RMEMBRES\n },
|
||||
|
|
Loading…
Reference in New Issue