|
@ -891,7 +891,10 @@ func (m *PeerManager) processPeerEvent(ctx context.Context, pu PeerUpdate) { |
|
|
case PeerStatusBad: |
|
|
case PeerStatusBad: |
|
|
m.store.peers[pu.NodeID].MutableScore-- |
|
|
m.store.peers[pu.NodeID].MutableScore-- |
|
|
case PeerStatusGood: |
|
|
case PeerStatusGood: |
|
|
m.store.peers[pu.NodeID].MutableScore++ |
|
|
|
|
|
|
|
|
// The persistent peer rank won't be affected by the score update.
|
|
|
|
|
|
if m.store.peers[pu.NodeID].MutableScore < int64(MaxPeerScoreNotPersistent) { |
|
|
|
|
|
m.store.peers[pu.NodeID].MutableScore++ |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|