mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
p2p/discover: panic instead of error log for missing node
This commit is contained in:
parent
3b4fd32f94
commit
66e3b383d4
1 changed files with 5 additions and 4 deletions
|
|
@ -72,10 +72,11 @@ func (t *talkSystem) register(protocol string, handler TalkRequestHandler) {
|
|||
|
||||
// handleRequest handles a talk request.
|
||||
func (t *talkSystem) handleRequest(id enode.ID, addr netip.AddrPort, req *v5wire.TalkRequest) {
|
||||
var n *enode.Node
|
||||
if n = t.transport.codec.SessionNode(id, addr.String()); n == nil {
|
||||
log.Error("Got a TALKREQ from a node that has not completed the handshake", "id", id, "addr", addr)
|
||||
return
|
||||
n := t.transport.codec.SessionNode(id, addr.String())
|
||||
if n == nil {
|
||||
// The node must be contained in the session here, since we wouldn't have
|
||||
// received the request otherwise.
|
||||
panic("missing node in session")
|
||||
}
|
||||
t.mutex.Lock()
|
||||
handler, ok := t.handlers[req.Protocol]
|
||||
|
|
|
|||
Loading…
Reference in a new issue