From 8a672c7faf5eb29c8ab45d9ae59094f51dab3aba Mon Sep 17 00:00:00 2001 From: jeka Date: Fri, 4 Oct 2024 23:22:44 +0300 Subject: [PATCH] restart mining on error --- mine.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mine.js b/mine.js index 2e9ac87..4a2f167 100644 --- a/mine.js +++ b/mine.js @@ -29,7 +29,12 @@ const run = async()=>{ const doMine = async(minerInstance)=>{ while (true) { - await minerInstance.mine(); + try { + await minerInstance.mine(); + } catch (e) { + console.error(e); + console.log('restarting the miner instance...'); + } await new Promise((res)=>setTimeout(res, 100)); }; };