les: UDP pre-negotiation of available server capacity (#22183)

This PR implements the first one of the "lespay" UDP queries which
is already useful in itself: the capacity query. The server pool is making
use of this query by doing a cheap UDP query to determine whether it is
worth starting the more expensive TCP connection process.
This commit is contained in:
Felföldi Zsolt
2021-03-01 10:24:20 +01:00
committed by GitHub
parent 498458b410
commit d96870428f
18 changed files with 915 additions and 89 deletions

View File

@ -599,6 +599,7 @@ func (ns *NodeStateMachine) updateEnode(n *enode.Node) (enode.ID, *nodeInfo) {
node := ns.nodes[id]
if node != nil && n.Seq() > node.node.Seq() {
node.node = n
node.dirty = true
}
return id, node
}