diff --git a/haproxy/js/challenge.js b/haproxy/js/challenge.js index 8ba602d..ef22c6b 100644 --- a/haproxy/js/challenge.js +++ b/haproxy/js/challenge.js @@ -89,7 +89,8 @@ const powFinished = new Promise((resolve, reject) => { const elapsedSec = Math.floor((Date.now()-start)/1000); const hps = Math.floor(totalHashes/elapsedSec); const requiredSec = Math.floor(eHashes/hps) * 1.5; //estimate 1.5x time - return updateElem('.powstatus', `Proof-of-work: ${hps}H/s, ~${Math.floor(requiredSec-elapsedSec)}s remaining`); + const remainingSec = Math.max(0, Math.floor(requiredSec-elapsedSec)); //dont show negative time + return updateElem('.powstatus', `Proof-of-work: ${hps}H/s, ~${remainingSec}s remaining`); } if (finished) { return; } finished = true;