From 21ff3f1d788b49fb125675e2604f23fb60474bdc Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Mon, 22 Feb 2016 00:00:26 -0800 Subject: [PATCH] fix orphan pruning. --- lib/bcoin/chain.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/bcoin/chain.js b/lib/bcoin/chain.js index 482547a6..06fec87e 100644 --- a/lib/bcoin/chain.js +++ b/lib/bcoin/chain.js @@ -1287,7 +1287,7 @@ Chain.prototype.add = function add(initial, peer, callback, force) { // Failsafe for large orphan chains. Do not // allow more than 20mb stored in memory. if (self.orphan.size > self.orphanLimit) - self.pruneOrphans(); + self.pruneOrphans(peer); // Keep track of total blocks handled. self.total += total; @@ -1316,7 +1316,7 @@ Chain.prototype.purgeOrphans = function purgeOrphans() { this.orphan.size = 0; }; -Chain.prototype.pruneOrphans = function pruneOrphans() { +Chain.prototype.pruneOrphans = function pruneOrphans(peer) { var self = this; var best, last;