p2p/discover: improve table addition code (#18974)
This change clears up confusion around the two ways in which nodes can be added to the table. When a neighbors packet is received as a reply to findnode, the nodes contained in the reply are added as 'seen' entries if sufficient space is available. When a ping is received and the endpoint verification has taken place, the remote node is added as a 'verified' entry or moved to the front of the bucket if present. This also updates the node's IP address and port if they have changed.
Showing
- p2p/discover/table.go 81 additions, 36 deletionsp2p/discover/table.go
- p2p/discover/table_test.go 91 additions, 5 deletionsp2p/discover/table_test.go
- p2p/discover/table_util_test.go 1 addition, 19 deletionsp2p/discover/table_util_test.go
- p2p/discover/udp.go 2 additions, 2 deletionsp2p/discover/udp.go
Loading
Please register or sign in to comment