garbage collection.

This commit is contained in:
Christopher Jeffrey 2014-10-20 08:53:54 -07:00
parent 42c8dd934e
commit 4211499b0e

View File

@ -306,6 +306,9 @@ Bitcoin.prototype._pollBlocks = function() {
// XXX Bad workaround
if (self._emitted[block.hash]) {
if (Object.keys(self._emitted[block.hash]).length > 10000) {
self._emitted = {};
}
return setImmediate(function() {
return nextBlock();
});
@ -353,6 +356,9 @@ Bitcoin.prototype._pollMempool = function() {
// XXX Bad workaround
if (self._emitted[tx.txid]) {
if (Object.keys(self._emitted[block.hash]).length > 10000) {
self._emitted = {};
}
return setImmediate(function() {
return nextTx();
});