diff --git a/nano/core_test/ipc.cpp b/nano/core_test/ipc.cpp index a12ce3e7cf..fc24f0beda 100644 --- a/nano/core_test/ipc.cpp +++ b/nano/core_test/ipc.cpp @@ -189,3 +189,19 @@ TEST (ipc, permissions_default_user_order) nano::ipc::access access; ASSERT_TRUE (access.deserialize_toml (toml)); } + +TEST (ipc, invalid_endpoint) +{ + nano::system system (1); + system.nodes[0]->config.ipc_config.transport_tcp.enabled = true; + system.nodes[0]->config.ipc_config.transport_tcp.port = 24077; + nano::node_rpc_config node_rpc_config; + nano::ipc::ipc_client client (system.nodes[0]->io_ctx); + + std::atomic call_completed{ false }; + client.async_connect ("::-1", 24077, [&client, &call_completed] (nano::error err) { + ASSERT_IS_ERROR (static_cast (err)); + call_completed = true; + }); + ASSERT_TIMELY (5s, call_completed); +} \ No newline at end of file diff --git a/nano/lib/ipc_client.cpp b/nano/lib/ipc_client.cpp index b2eea05b2b..31c6aac747 100644 --- a/nano/lib/ipc_client.cpp +++ b/nano/lib/ipc_client.cpp @@ -64,7 +64,7 @@ class socket_client : public nano::ipc::socket_base, public channel, public std: } else { - callback (ec, *end); + callback (ec, boost::asio::ip::tcp::endpoint ()); } }); }