From f26273f34f87ee3acd375b529ec7f0c4b9eb7ab5 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sun, 24 Aug 2014 13:18:47 +1000 Subject: [PATCH] Attempt failover when bitcoind socket is invalidated --- src/generator.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/generator.c b/src/generator.c index d45bdcd8..d703602c 100644 --- a/src/generator.c +++ b/src/generator.c @@ -237,6 +237,11 @@ retry: } } while (selret < 1); + if (unlikely(cs->fd < 0)) { + LOGWARNING("Bitcoind socket invalidated, will atempt failover"); + goto reconnect; + } + sockd = accept(us->sockd, NULL, NULL); if (sockd < 0) { LOGEMERG("Failed to accept on generator socket");