From 737775aa1762b1864aedafe9096da4f0eb32b3b5 Mon Sep 17 00:00:00 2001 From: kdeme Date: Wed, 23 Aug 2023 15:29:36 +0200 Subject: [PATCH] Let getEnr JSON-RPC also return local ENR --- fluffy/rpc/rpc_portal_api.nim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fluffy/rpc/rpc_portal_api.nim b/fluffy/rpc/rpc_portal_api.nim index 757c3f4970..85929da8e8 100644 --- a/fluffy/rpc/rpc_portal_api.nim +++ b/fluffy/rpc/rpc_portal_api.nim @@ -55,6 +55,9 @@ proc installPortalApiHandlers*( return true rpcServer.rpc("portal_" & network & "GetEnr") do(nodeId: NodeId) -> Record: + if p.localNode.id == nodeId: + return p.localNode.record + let node = p.getNode(nodeId) if node.isSome(): return node.get().record