From f6c3c255e17a1f1f81f811f90bb624000eed6506 Mon Sep 17 00:00:00 2001 From: jay tseng Date: Wed, 16 Mar 2022 13:25:59 -0400 Subject: [PATCH] adjust max non-persistent peer score --- internal/p2p/peermanager.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/p2p/peermanager.go b/internal/p2p/peermanager.go index 3293468ae..c6b4c8635 100644 --- a/internal/p2p/peermanager.go +++ b/internal/p2p/peermanager.go @@ -42,7 +42,8 @@ const ( type PeerScore uint8 const ( - PeerScorePersistent PeerScore = math.MaxUint8 // persistent peers + PeerScorePersistent PeerScore = math.MaxUint8 // persistent peers + MaxPeerScoreNotPersistent PeerScore = PeerScorePersistent - 1 ) // PeerUpdate is a peer update event sent via PeerUpdates. @@ -1295,7 +1296,7 @@ func (p *peerInfo) Score() PeerScore { } if score >= math.MaxUint8 { - return PeerScore(math.MaxUint8) + return MaxPeerScoreNotPersistent } return PeerScore(score)