mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-07-30 05:23:30 +00:00
fix(tools/mix): register DhtProxyCodec read behavior for relay-only mode
Signed-off-by: Chrysostomos Nanakos <chris@include.gr>
This commit is contained in:
parent
1a97cc8c2e
commit
851f38d902
@ -431,11 +431,6 @@ proc runWithDhtProxy(
|
||||
config = discoveryConfig,
|
||||
)
|
||||
|
||||
let maxReplyBytes = getMaxMessageSizeForCodec(DhtProxyCodec, 0).valueOr:
|
||||
raise
|
||||
newException(ValueError, "DhtProxyCodec does not fit Sphinx payload: " & error)
|
||||
mixProto.registerDestReadBehavior(DhtProxyCodec, readLp(maxReplyBytes))
|
||||
|
||||
let proxyProto = DhtProxyProtocol.new(dht, maxInFlight = conf.maxInFlight)
|
||||
|
||||
try:
|
||||
@ -573,6 +568,11 @@ proc run(conf: Conf) {.async: (raises: [CatchableError]).} =
|
||||
|
||||
let mixProto = MixProtocol.new(nodeInfo, switch)
|
||||
|
||||
let maxReplyBytes = getMaxMessageSizeForCodec(DhtProxyCodec, 0).valueOr:
|
||||
raise
|
||||
newException(ValueError, "DhtProxyCodec does not fit Sphinx payload: " & error)
|
||||
mixProto.registerDestReadBehavior(DhtProxyCodec, readLp(maxReplyBytes))
|
||||
|
||||
if conf.noDhtProxy:
|
||||
await runRelayOnly(conf, switch, mixProto, peerId, tcpAddr)
|
||||
else:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user