From 486c22d0e7e64171169fe5af9b1baa8db81460bf Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Tue, 19 Jan 2016 20:36:16 -0800 Subject: [PATCH] get rid of getStartHeight. --- lib/bcoin/chain.js | 4 ---- lib/bcoin/peer.js | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/bcoin/chain.js b/lib/bcoin/chain.js index e9a0208c..fcf8f9a0 100644 --- a/lib/bcoin/chain.js +++ b/lib/bcoin/chain.js @@ -577,10 +577,6 @@ Chain.prototype.hashRange = function hashRange(start, end) { return hashes; }; -Chain.prototype.getStartHeight = function getStartHeight() { - return this.index.entries[this.index.entries.length - 1].height; -}; - Chain.prototype.locatorHashes = function locatorHashes(start) { var chain = this.index.hashes; var hashes = []; diff --git a/lib/bcoin/peer.js b/lib/bcoin/peer.js index b70de2b8..9cf140ce 100644 --- a/lib/bcoin/peer.js +++ b/lib/bcoin/peer.js @@ -141,7 +141,7 @@ Peer.prototype._init = function init() { this.once('version', function() { self.pool.emit('debug', 'Sent version (%s): height=%s', - self.host, this.pool.chain.getStartHeight()); + self.host, this.pool.chain.height()); }); } @@ -171,7 +171,7 @@ Peer.prototype._init = function init() { // Send hello this._write(this.framer.version({ - height: this.pool.chain.getStartHeight(), + height: this.pool.chain.height(), relay: this.options.relay })); };