Skip to content

Commit

Permalink
p2p: fix length calculation for headPeers method (#1708)
Browse files Browse the repository at this point in the history
  • Loading branch information
j75689 authored Jun 16, 2023
1 parent 9841ba5 commit acd2f5f
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 @@ -517,6 +517,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 acd2f5f

Please sign in to comment.