Use DhtMode

This commit is contained in:
Arnaud 2026-05-04 18:37:02 +04:00
parent 897573d437
commit c7521be1ca
No known key found for this signature in database
GPG Key ID: A6C7C781817146FA

View File

@ -1233,9 +1233,9 @@ proc open*(d: Protocol) {.raises: [Defect, CatchableError].} =
protocolHandler: proc(p: TalkProtocol, request: seq[byte], fromId: NodeId,
fromUdpAddress: Address): seq[byte] {.raises: [].} =
if d.clientMode:
@[byte 1]
@[DhtMode.Client.byte]
else:
@[byte 0]
@[DhtMode.Server.byte]
)
d.registerTalkProtocol(clientModeProtocolId, clientModeProtocol).expect(
"Only one protocol should have this id"