From 7e2aad259048f901819a146c351525e0cd14aad1 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Fri, 22 Mar 2019 14:11:59 -0700 Subject: [PATCH] Refrain from trying to configure a staking account that was previously configured --- multinode-demo/common.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/multinode-demo/common.sh b/multinode-demo/common.sh index b7c933d26a..7cfed65f9b 100644 --- a/multinode-demo/common.sh +++ b/multinode-demo/common.sh @@ -151,6 +151,11 @@ setup_fullnode_staking() { declare staker_id staker_id=$($solana_wallet --keypair "$staker_id_path" address) + if [[ -f "$staker_id_path".configured ]]; then + echo "Staking account has already been configured" + return 0 + fi + # A fullnode requires 43 lamports to function: # - one lamport to keep the node identity public key valid. TODO: really?? # - 42 more for the staker account we fund @@ -169,6 +174,8 @@ setup_fullnode_staking() { --delegate-account "$fullnode_id" \ --authorize-voter "$staker_id" || return $? + + touch "$staker_id_path".configured return 0 }