Skip to content

Commit

Permalink
eth/protocols/eth: fix loading "eth" ENR key in dial filter (#31251)
Browse files Browse the repository at this point in the history
This fixes an issue where dial candidates from discv5 would be ignored
because the "eth" ENR entry was not loaded correctly.
  • Loading branch information
islishude authored Feb 25, 2025
1 parent f688343 commit 756310f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion eth/protocols/eth/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ func StartENRUpdater(chain *core.BlockChain, ln *enode.LocalNode) {
var newHead = make(chan core.ChainHeadEvent, 10)
sub := chain.SubscribeChainHeadEvent(newHead)

ln.Set(currentENREntry(chain))
go func() {
defer sub.Unsubscribe()
for {
Expand Down Expand Up @@ -71,7 +72,7 @@ func NewNodeFilter(chain *core.BlockChain) func(*enode.Node) bool {
filter := forkid.NewFilter(chain)
return func(n *enode.Node) bool {
var entry enrEntry
if err := n.Load(entry); err != nil {
if err := n.Load(&entry); err != nil {
return false
}
err := filter(entry.ForkID)
Expand Down

0 comments on commit 756310f

Please sign in to comment.