diff --git a/lib/bitcoind.js b/lib/bitcoind.js index a7e04cb2..1c52411d 100644 --- a/lib/bitcoind.js +++ b/lib/bitcoind.js @@ -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(); });