Skip to content

Commit

Permalink
Properly retrying to fetch current beacon in the demo (#944)
Browse files Browse the repository at this point in the history
Fixes #807
  • Loading branch information
AnomalRoil committed Mar 30, 2022
1 parent 39a2752 commit 8bdec4b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions demo/lib/orchestrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,15 +292,17 @@ func (e *Orchestrator) checkBeaconNodes(nodes []node.Node, group string, tryCurl
fmt.Printf("\t - Example command is: \"%s\"\n", cmd)
break
} else {
if !bytes.Equal(randResp.GetSignature(), rand.GetSignature()) {
panic("[-] Inconsistent beacon signature between nodes")
}
// we first check both are at the same round
if randResp.GetRound() != rand.GetRound() {
fmt.Println("[-] Mismatch between last index", lastIndex, " vs current index ", node.Index(), " - trying again in some time...")
time.Sleep(100 * time.Millisecond)
// we try again
continue
}
// then we check if the signatures match
if !bytes.Equal(randResp.GetSignature(), rand.GetSignature()) {
panic("[-] Inconsistent beacon signature between nodes")
}
// everything is good
break
}
Expand Down

0 comments on commit 8bdec4b

Please sign in to comment.