mirror of
https://github.com/logos-storage/logos-storage-nim-dht.git
synced 2026-05-21 17:19:27 +00:00
Use DhtMode
This commit is contained in:
parent
897573d437
commit
c7521be1ca
@ -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"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user