Skip to content

Commit

Permalink
Let getEnr JSON-RPC also return local ENR (#1705)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdeme authored Aug 23, 2023
1 parent 6535b39 commit 0105e3e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fluffy/rpc/rpc_portal_api.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0105e3e

Please sign in to comment.