From 02bf4427edfcc6e163905c796b6200170e37c5cc Mon Sep 17 00:00:00 2001 From: Arnaud Date: Mon, 4 May 2026 15:25:42 +0400 Subject: [PATCH] Add register talk protocol unicity check --- codexdht/private/eth/p2p/discoveryv5/protocol.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/codexdht/private/eth/p2p/discoveryv5/protocol.nim b/codexdht/private/eth/p2p/discoveryv5/protocol.nim index 0bd93e5..f69bcd2 100644 --- a/codexdht/private/eth/p2p/discoveryv5/protocol.nim +++ b/codexdht/private/eth/p2p/discoveryv5/protocol.nim @@ -1225,7 +1225,9 @@ proc open*(d: Protocol) {.raises: [Defect, CatchableError].} = else: @[byte 0] ) - discard d.registerTalkProtocol(clientModeProtocolId, clientModeProtocol) + discard d.registerTalkProtocol(clientModeProtocolId, clientModeProtocol).expect( + "Only one protocol should have this id" + ) d.seedTable() trace "Routing table seeded."