fix(tools/mix): register DhtProxyCodec read behavior for relay-only mode

Signed-off-by: Chrysostomos Nanakos <chris@include.gr>
This commit is contained in:
Chrysostomos Nanakos 2026-06-18 17:33:17 +03:00
parent 1a97cc8c2e
commit 851f38d902
No known key found for this signature in database

View File

@ -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: