Skip to content
This repository was archived by the owner on Mar 5, 2020. It is now read-only.

Commit c8f8e81

Browse files
committed
In case the net is empty.
1 parent 5fb6ee6 commit c8f8e81

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

bios/network.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,5 +587,9 @@ func (net *Network) ConsensusDiscovery() (*disco.Discovery, error) {
587587
// Cycle through the top peers, take the most vetted
588588

589589
orderedPeers := net.OrderedPeers(net.MyNetwork())
590+
if len(orderedPeers) == 0 {
591+
return nil, fmt.Errorf("no other peers in sight")
592+
}
593+
590594
return orderedPeers[0].Discovery, nil
591595
}

0 commit comments

Comments
 (0)