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

View File

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