Browse Source

adjust max non-persistent peer score

pull/8137/head
jay tseng 3 years ago
parent
commit
f6c3c255e1
No known key found for this signature in database GPG Key ID: 5A9D3063305E6427
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      internal/p2p/peermanager.go

+ 3
- 2
internal/p2p/peermanager.go View File

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


Loading…
Cancel
Save