Fix unloop if 1 bloc diff

This commit is contained in:
poka 2020-09-27 20:49:04 +02:00
parent 09c09df9e6
commit e7adaa1990
3 changed files with 4 additions and 7 deletions

View File

@ -40,7 +40,6 @@ else
fi
TXBLOCKS=($(echo "$TXBLOCKS" | sort -hu | awk '{printf $1" "}'))
unset 'TXBLOCKS[${#TXBLOCKS[@]}-1]'
nbrMembers=$(echo "$membresPubkeys" | wc -l)
lastBloc=${TXBLOCKS[-1]}
isWeb=$1

View File

@ -13,8 +13,7 @@ scanTxWallets() {
local nbrMembersYesterday=$(cat "$startFile" | sed -e '1,/---/d' | sed -e '1,/---/d' | sed '/---/Q' | grep . | cut -d '|' -f 1)
local blockDateLast=$(cat "$startFile" | sed -e '1,/---/d' | sed -e '1,/---/d' | sed '/---/Q' | grep . | cut -d '|' -f 2)
local nbrDays=$(cat "$startFile" | sed -e '1,/---/d' | sed -e '1,/---/d' | sed '/---/Q' | grep . | cut -d '|' -f 3)
! ($debug) && [[ $lastBloc == $startBloc ]] && return
! ($debug) && [[ $lastBloc -le $startBloc || $startIter -ge ${#TXBLOCKS[@]} ]] && return
rm $startFile
else
local startIter=0
@ -22,7 +21,6 @@ scanTxWallets() {
local nbrDays=1
echo "[" > $jsonFile
fi
incExec=1
for ((i=$startIter; i<${#TXBLOCKS[@]}; i++)); do
local startExec=$(($(date +%s%N)/1000000))
@ -30,7 +28,7 @@ scanTxWallets() {
[[ -z $bloc ]] && break
# [[ $i -lt 1190 ]] && continue #kopa
# Récupère la date et l'objet transaction du bloc courant
# Récupération du bloc courant
local blocFull=$(curl -s ${DUNITER}/blockchain/block/$bloc)
until blocBrut=$(jq -r '.' <<<"$blocFull" 2>/dev/null); do
[[ $isWeb != "web" ]] && echo -e "i: $i\n$blocFull"
@ -171,7 +169,6 @@ scanTxWallets() {
nbrMembersYesterday=$nbrMembersTotalToday
unset nbrMembersToday
fi
echo "$blockDate - $nbrDays - $bloc - $lastUdBloc" >> debug.log
((nbrDays++))
fi
unset recusJson
@ -233,7 +230,7 @@ scanTxWallets() {
else
[[ -z $firstScan ]] && echo "Scan des blocs avec transactions en cours ..." && local firstScan=true
fi
# [[ $i -ge 1220 ]] && break #kopa
# [[ $i -ge $1 ]] && break #kopa
done
[[ $blockDateLast == $blockDate ]] && applyToday

View File

@ -9,6 +9,7 @@
<div class="header">
<center><h1>La Ḡ1 en quelques chiffres</h1>
<h3>Beta</h3>
<a href="/graph/mixed.html">Voir les graphiques</a></center>
</div>