eth/protocols/eth: add doc for NewNodeFilter

This commit is contained in:
lightclient 2024-08-15 09:13:44 -06:00
parent 0113cebed9
commit 77d9ec95f6
No known key found for this signature in database
GPG key ID: 75C916AFEE20183E

View file

@ -65,6 +65,8 @@ func currentENREntry(chain *core.BlockChain) *enrEntry {
} }
} }
// NewNodeFilter returns a filtering function that returns whether the provided
// enode advertises a forkid compatible with the current chain.
func NewNodeFilter(chain *core.BlockChain) func(*enode.Node) bool { func NewNodeFilter(chain *core.BlockChain) func(*enode.Node) bool {
filter := forkid.NewFilter(chain) filter := forkid.NewFilter(chain)
return func(n *enode.Node) bool { return func(n *enode.Node) bool {