From 45d09b33adbc2e500eb41d6087514d025f9eaf85 Mon Sep 17 00:00:00 2001 From: Trent Nelson Date: Wed, 9 Sep 2020 17:06:34 -0600 Subject: [PATCH] net.sh: Smarter wait slot resolution for --extra-primordial-stakes --- net/net.sh | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/net/net.sh b/net/net.sh index 9e9352723..ff649fa93 100755 --- a/net/net.sh +++ b/net/net.sh @@ -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