blockchain v0: no-op on empty peer IDs

This commit is contained in:
Aleksandr Bezobchuk
2021-01-12 08:56:08 -05:00
parent 7aff59cd86
commit 2201204418
+4
View File
@@ -322,6 +322,10 @@ func (r *Reactor) processBlockchainCh() {
func (r *Reactor) processPeerUpdate(peerUpdate p2p.PeerUpdate) {
r.Logger.Debug("received peer update", "peer", peerUpdate.PeerID, "status", peerUpdate.Status)
if len(peerUpdate.PeerID) == 0 {
return
}
switch peerUpdate.Status {
case p2p.PeerStatusNew, p2p.PeerStatusUp:
// send a status update the newly added peer