Skip to content

p2p/discover: expose discv5 functions for portal JSON-RPC interface #31117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 13, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
feat: expose table nodes
Signed-off-by: Chen Kai <[email protected]>
  • Loading branch information
GrapeBaBa committed Mar 12, 2025
commit bd1f98c24afbb69069106d9fdddc4af1aabd47db
5 changes: 5 additions & 0 deletions p2p/discover/v5_udp.go
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,11 @@ func (t *UDPv5) GetNode(id enode.ID) *enode.Node {
return nil
}

// Nodes returns the nodes in the routing table.
func (t *UDPv5) Nodes() [][]BucketNode {
return t.tab.Nodes()
}

// handle processes incoming packets according to their message type.
func (t *UDPv5) handle(p v5wire.Packet, fromID enode.ID, fromAddr netip.AddrPort) {
switch p := p.(type) {
Expand Down