Do not return node_id private key in RPC call (#4459)

It could become a problem one day.
This is breaking a debug API, that nobody should be using for serious tasks. So it should not cause any problems.
This commit is contained in:
Dimitrios Siganos 2024-03-05 18:34:20 +00:00 committed by GitHub
commit 42544be68e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 0 additions and 2 deletions

View file

@ -2922,7 +2922,6 @@ void nano::json_handler::node_id ()
{
if (!ec)
{
response_l.put ("private", node.node_id.prv.to_string ());
response_l.put ("public", node.node_id.pub.to_string ());
response_l.put ("as_account", node.node_id.pub.to_account ());
response_l.put ("node_id", node.node_id.pub.to_node_id ());

View file

@ -5406,7 +5406,6 @@ TEST (rpc, node_id)
boost::property_tree::ptree request;
request.put ("action", "node_id");
auto response (wait_response (system, rpc_ctx, request));
ASSERT_EQ (node->node_id.prv.to_string (), response.get<std::string> ("private"));
ASSERT_EQ (node->node_id.pub.to_account (), response.get<std::string> ("as_account"));
ASSERT_EQ (node->node_id.pub.to_node_id (), response.get<std::string> ("node_id"));
}