Let getEnr JSON-RPC also return local ENR (#1705)

This commit is contained in:
Kim De Mey 2023-08-23 18:18:03 +02:00 committed by GitHub
parent 6535b39e47
commit 0105e3e8cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

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