diff --git a/lib/modules/blockchain_connector/index.js b/lib/modules/blockchain_connector/index.js index 84593ffd..6ab95f25 100644 --- a/lib/modules/blockchain_connector/index.js +++ b/lib/modules/blockchain_connector/index.js @@ -235,6 +235,14 @@ class BlockchainConnector { if (err && err !== NO_NODE) { return cb(err); } + else if ((statusObj && statusObj.status === 'off') || err === NO_NODE){ + self.provider.stop(); + self.events.on('check:backOnline:Ethereum', () => { + self.provider.startWeb3Provider(() => { + self.logger.trace('web3 provider restarted after ethereum node came back online'); + }); + }); + } cb(statusObj); }); }, 5000, 'off');