Skip to content

Commit

Permalink
fix: headPeers method length calculation is incorrect
Browse files Browse the repository at this point in the history
  • Loading branch information
j75689 committed Jun 15, 2023
1 parent f257d62 commit 32a4112
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions eth/peerset.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ func (ps *peerSet) headPeers(num uint) []*ethPeer {

list := make([]*ethPeer, 0, num)
for _, p := range ps.peers {
if len(list) > int(num) {
break
}
list = append(list, p)
}
return list
Expand Down

0 comments on commit 32a4112

Please sign in to comment.