diff --git a/lib/bcoin/chain.js b/lib/bcoin/chain.js index 6551225d..24163ec9 100644 --- a/lib/bcoin/chain.js +++ b/lib/bcoin/chain.js @@ -34,7 +34,6 @@ var VerifyError = utils.VerifyError; * @property {Locker} locker * @property {Object} invalid * @property {Number} bestHeight - * @property {Number} lastUpdate * @property {ChainBlock?} tip * @property {Number} height * @property {Boolean} segwitActive @@ -75,7 +74,6 @@ function Chain(options) { this.locker = new bcoin.locker(this, this.add, this.pendingLimit); this.invalid = {}; this.bestHeight = -1; - this.lastUpdate = utils.now(); this.tip = null; this.height = -1; this.synced = false; @@ -717,7 +715,7 @@ Chain.prototype._checkDuplicates = function _checkDuplicates(block, prev, callba if (network.block.bip34height === -1 || height <= network.block.bip34height) return this._findDuplicates(block, prev, callback); - self.db.get(network.block.bip34height, function(err, entry) { + this.db.get(network.block.bip34height, function(err, entry) { if (err) return callback(err); @@ -1206,10 +1204,6 @@ Chain.prototype._setBestChain = function _setBestChain(entry, prev, block, callb }); } - // Update the timestamp to - // maintain a time delta of blocks. - this.lastUpdate = utils.now(); - // We don't have a genesis block yet. if (!this.tip) { if (entry.hash !== network.genesis.hash) { @@ -1827,22 +1821,6 @@ Chain.prototype.getOrphan = function getOrphan(hash) { return this.orphan.bmap[hash] || null; }; -/** - * Test the chain to see if it is synced. - * @returns {Boolean} - */ - -Chain.prototype.isFullLegacy = function isFull() { - var delta; - - if (!this.tip) - return false; - - delta = utils.now() - this.tip.ts; - - return delta < 4 * 60 * 60; -}; - /** * Test the chain to see if it is synced. * @returns {Boolean} @@ -1852,27 +1830,6 @@ Chain.prototype.isFull = function isFull() { return !this.isInitial(); }; -/** - * Test the chain to see if it is still in the initial - * syncing phase. Mimic's bitcoind's `IsInitialBlockDownload()` - * function. - * @see IsInitalBlockDownload() - * @returns {Boolean} - */ - -Chain.prototype.isInitialLegacy = function isInitial() { - var now, delta; - - if (!this.tip) - return true; - - now = utils.now(); - delta = now - this.lastUpdate; - - // Should mimic the original IsInitialBlockDownload() function - return delta < 10 && this.tip.ts < now - 24 * 60 * 60; -}; - /** * Test the chain to see if it is still in the initial * syncing phase. Mimic's bitcoind's `IsInitialBlockDownload()`