diff --git a/BlueElectrum.js b/BlueElectrum.js index 37c660cd..497c3668 100644 --- a/BlueElectrum.js +++ b/BlueElectrum.js @@ -364,6 +364,10 @@ module.exports.multiGetTransactionByTxid = async function(txids, batchsize, verb if (txhashHeightCache[txid]) { // got blockheight where this tx was confirmed tx.confirmations = this.estimateCurrentBlockheight() - txhashHeightCache[txid]; + if (tx.confirmations < 0) { + // ugly fix for when estimator lags behind + tx.confirmations = 1; + } tx.time = this.calculateBlockTime(txhashHeightCache[txid]); tx.blocktime = this.calculateBlockTime(txhashHeightCache[txid]); } @@ -463,7 +467,7 @@ module.exports.broadcastV2 = async function(hex) { module.exports.estimateCurrentBlockheight = function() { const baseTs = 1585837504347; // uS - const baseHeight = 624083; + const baseHeight = 624197; return Math.floor(baseHeight + (+new Date() - baseTs) / 1000 / 60 / 10); };