mirror of
https://github.com/tendermint/tendermint.git
synced 2026-08-20 22:26:15 +00:00
p2p: peer score should not wrap around (#8790)
(cherry picked from commit 4d820ff4f5)
# Conflicts:
# internal/p2p/peermanager.go
This commit is contained in:
@@ -1300,12 +1300,17 @@ func (p *peerInfo) Score() PeerScore {
|
||||
score -= int64(addr.DialFailures)
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
if score <= 0 {
|
||||
return 0
|
||||
}
|
||||
|
||||
if score >= math.MaxUint8 {
|
||||
return PeerScore(math.MaxUint8)
|
||||
=======
|
||||
if score < math.MinInt16 {
|
||||
score = math.MinInt16
|
||||
>>>>>>> 4d820ff4f (p2p: peer score should not wrap around (#8790))
|
||||
}
|
||||
|
||||
return PeerScore(score)
|
||||
|
||||
Reference in New Issue
Block a user