From e3068b50b272f28b5ba627cb4e92fef2b4de2e21 Mon Sep 17 00:00:00 2001 From: tycho garen Date: Fri, 10 Jun 2022 11:51:36 -0400 Subject: [PATCH] make const --- internal/p2p/peermanager.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/p2p/peermanager.go b/internal/p2p/peermanager.go index 09690cb31..abfa35e9d 100644 --- a/internal/p2p/peermanager.go +++ b/internal/p2p/peermanager.go @@ -44,6 +44,7 @@ type PeerScore int const ( PeerScorePersistent PeerScore = math.MaxInt16 // persistent peers MaxPeerScoreNotPersistent PeerScore = PeerScorePersistent - 1 + DefaultMutablePeerScore int64 = 256 ) // PeerUpdate is a peer update event sent via PeerUpdates. @@ -411,7 +412,7 @@ func (m *PeerManager) Add(address NodeAddress) (bool, error) { // set the peer's mutable score to something non-zero so that // peer's we've never - peer.MutableScore = 256 + peer.MutableScore = DefaultMutablePeerScore // else add the new address peer.AddressInfo[address] = &peerAddressInfo{Address: address}