Skip accessing peer status if it does not exist (#4226)

* skip accessing peer status if it does not exist
* Merge refs/heads/master into fix-panic-rr
This commit is contained in:
Preston Van Loon 2019-12-08 15:30:39 -08:00 committed by prylabs-bulldozer[bot]
parent 0cb681476e
commit 92d21c72b8

View File

@ -306,6 +306,9 @@ func bestFinalized() ([]byte, uint64, []peer.ID) {
rootToEpoch := make(map[[32]byte]uint64)
for _, k := range peerstatus.Keys() {
s := peerstatus.Get(k)
if s == nil {
continue
}
r := bytesutil.ToBytes32(s.FinalizedRoot)
finalized[r]++
rootToEpoch[r] = s.FinalizedEpoch