p2p/discover: split out discv4 code
This change restructures the internals of p2p/discover to make room for the discv5 code which will soon be added to this package. - packet type names now have a "V4" suffix. - ListenUDP returns *UDPv4 instead of *Table. This technically breaks the API but the only caller in go-ethereum is package p2p, which uses a compatible interface and doesn't need changes. - The internal transport interface is changed to make Table reusable for v5. - The 'lookup' code moves from table to transport. This required updating the lookup unit test to use udpTest instead of a custom transport.
Showing
- p2p/discover/common.go 57 additions, 0 deletionsp2p/discover/common.go
- p2p/discover/table.go 45 additions, 163 deletionsp2p/discover/table.go
- p2p/discover/table_test.go 9 additions, 301 deletionsp2p/discover/table_test.go
- p2p/discover/table_util_test.go 31 additions, 16 deletionsp2p/discover/table_util_test.go
- p2p/discover/v4_udp.go 248 additions, 135 deletionsp2p/discover/v4_udp.go
- p2p/discover/v4_udp_lookup_test.go 220 additions, 0 deletionsp2p/discover/v4_udp_lookup_test.go
- p2p/discover/v4_udp_test.go 90 additions, 85 deletionsp2p/discover/v4_udp_test.go
Loading
Please register or sign in to comment