fix orphan pruning.

This commit is contained in:
Christopher Jeffrey 2016-02-22 00:00:26 -08:00
parent d6bef43d71
commit 21ff3f1d78

View File

@ -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;