Skip to content

Commit

Permalink
rename allowlist to whitelist
Browse files Browse the repository at this point in the history
  • Loading branch information
omerfirmak committed Jul 31, 2024
1 parent 131820e commit a845dc9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions eth/peerset.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ func (ps *peerSet) snapLen() int {

// peerWithHighestTD retrieves the known peer with the currently highest total
// difficulty.
func (ps *peerSet) peerWithHighestTD(allowList []string) *eth.Peer {
func (ps *peerSet) peerWithHighestTD(whileList []string) *eth.Peer {
ps.lock.RLock()
defer ps.lock.RUnlock()

Expand All @@ -241,7 +241,7 @@ func (ps *peerSet) peerWithHighestTD(allowList []string) *eth.Peer {
bestTd *big.Int
)
for _, p := range ps.peers {
if allowList != nil && !slices.Contains(allowList, p.ID()) {
if whileList != nil && !slices.Contains(whileList, p.ID()) {
continue
}
if _, td := p.Head(); bestPeer == nil || td.Cmp(bestTd) > 0 {
Expand Down
6 changes: 3 additions & 3 deletions eth/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,17 +157,17 @@ func (cs *chainSyncer) nextSyncOp() *chainSyncOp {
return nil
}

var syncAllowList []string
var syncWhiteList []string
chainConfig := cs.handler.chain.Config()
currentHeight := cs.handler.chain.CurrentHeader().Number.Uint64()
if chainConfig.Clique != nil {
shadowForkHeight := chainConfig.Clique.ShadowForkHeight
if shadowForkHeight != 0 && currentHeight >= shadowForkHeight {
syncAllowList = cs.handler.shadowForkPeerIDs
syncWhiteList = cs.handler.shadowForkPeerIDs
}
}
// We have enough peers, check TD
peer := cs.handler.peers.peerWithHighestTD(syncAllowList)
peer := cs.handler.peers.peerWithHighestTD(syncWhiteList)
if peer == nil {
return nil
}
Expand Down

0 comments on commit a845dc9

Please sign in to comment.