From f9e3f8cbbb8d9eac18aafe5db4cb2f588f48fc4d Mon Sep 17 00:00:00 2001 From: DcruBro Date: Thu, 23 Jul 2026 14:23:38 +0200 Subject: [PATCH] SIGPIPE fix - don't terminate on nodes being nodes --- src/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.c b/src/main.c index 5de6a27..df622b5 100644 --- a/src/main.c +++ b/src/main.c @@ -674,6 +674,10 @@ int main(int argc, char* argv[]) { ApplyRuntimeConfigFromEnv(); signal(SIGINT, handle_sigint); + // Ignore SIGPIPE so a write to a socket whose peer has already disconnected returns EPIPE + // (handled by the send paths) instead of terminating the whole process. Peers connecting and + // disconnecting is normal p2p behaviour and must never take the node down. + signal(SIGPIPE, SIG_IGN); srand((unsigned int)time(NULL)); // Initialize runtime locks before any thread or helper can touch chain state.