net.sh: Smarter wait slot resolution for --extra-primordial-stakes

This commit is contained in:
Trent Nelson 2020-09-09 17:06:34 -06:00 committed by Trent Nelson
parent cade92d2b4
commit 45d09b33ad
1 changed files with 15 additions and 6 deletions

View File

@ -874,12 +874,6 @@ while [[ -n $1 ]]; do
shift 1
elif [[ $1 == --extra-primordial-stakes ]]; then
extraPrimordialStakes=$2
# Extra primoridial stakes require that all of the validators start at
# the same time. Force async init and wait for supermajority here.
waitForNodeInit=false
if [[ -z "$maybeWaitForSupermajority" ]]; then
maybeWaitForSupermajority="--wait-for-supermajority 1"
fi
shift 2
else
usage "Unknown long option: $1"
@ -1009,6 +1003,21 @@ if [[ -n "$maybeWaitForSupermajority" && -n "$maybeWarpSlot" ]]; then
fi
fi
if [[ -n "$extraPrimordialStakes" ]]; then
# Extra primoridial stakes require that all of the validators start at
# the same time. Force async init and wait for supermajority here.
waitForNodeInit=false
if [[ -z "$maybeWaitForSupermajority" ]]; then
waitSlot=
if [[ -n "$maybeWarpSlot" ]]; then
read -r _ waitSlot <<<"$maybeWarpSlot"
else
waitSlot=1
fi
maybeWaitForSupermajority="--wait-for-supermajority $waitSlot"
fi
fi
checkPremptibleInstances
case $command in