fix bad walletUp loop

This commit is contained in:
poka 2020-09-13 19:16:32 +02:00
parent 254b883b4f
commit c444c3035e
2 changed files with 6 additions and 8 deletions

View File

@ -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)

View File

@ -1 +1 @@
{\n \"date\": \"_DATE\",\n \"rWallets\": \"_RWALLETS\",\n \"rMembres\": \"_RMEMBRES\"\n },
{\n \"date\": \"_DATE\",\n \"rWallets\": _RWALLETS,\n \"rMembres\": _RMEMBRES\n },