diff --git a/src/ipc/interfaces.cpp b/src/ipc/interfaces.cpp index f40913d1853..1171f706487 100644 --- a/src/ipc/interfaces.cpp +++ b/src/ipc/interfaces.cpp @@ -95,10 +95,13 @@ public: fd = m_process->connect(gArgs.GetDataDirNet(), "bitcoin-node", address); } catch (const std::system_error& e) { // If connection type is auto and socket path isn't accepting connections, or doesn't exist, catch the error and return null; - if (e.code() == std::errc::connection_refused || e.code() == std::errc::no_such_file_or_directory) { + if (e.code() == std::errc::connection_refused || e.code() == std::errc::no_such_file_or_directory || e.code() == std::errc::not_a_directory) { return nullptr; } throw; + } catch (const std::invalid_argument&) { + // Catch 'Unix address path "..." exceeded maximum socket path length' error + return nullptr; } } else { fd = m_process->connect(gArgs.GetDataDirNet(), "bitcoin-node", address);