mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 07:06:42 +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.
|
// handleRequest handles a talk request.
|
||||||
func (t *talkSystem) handleRequest(id enode.ID, addr netip.AddrPort, req *v5wire.TalkRequest) {
|
func (t *talkSystem) handleRequest(id enode.ID, addr netip.AddrPort, req *v5wire.TalkRequest) {
|
||||||
var n *enode.Node
|
n := t.transport.codec.SessionNode(id, addr.String())
|
||||||
if n = t.transport.codec.SessionNode(id, addr.String()); n == nil {
|
if n == nil {
|
||||||
log.Error("Got a TALKREQ from a node that has not completed the handshake", "id", id, "addr", addr)
|
// The node must be contained in the session here, since we wouldn't have
|
||||||
return
|
// received the request otherwise.
|
||||||
|
panic("missing node in session")
|
||||||
}
|
}
|
||||||
t.mutex.Lock()
|
t.mutex.Lock()
|
||||||
handler, ok := t.handlers[req.Protocol]
|
handler, ok := t.handlers[req.Protocol]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue