make const

This commit is contained in:
tycho garen
2022-06-10 11:51:36 -04:00
parent 4e2bc8f51e
commit e3068b50b2

View File

@@ -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}