From d42e29ecbedad47f10bee8d225110608309ca614 Mon Sep 17 00:00:00 2001 From: Chris Kleeschulte Date: Tue, 24 Jan 2017 16:47:13 -0500 Subject: [PATCH] Corrected mempool removal logic. --- lib/services/transaction.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/services/transaction.js b/lib/services/transaction.js index a4d45798..b2261a18 100644 --- a/lib/services/transaction.js +++ b/lib/services/transaction.js @@ -102,8 +102,10 @@ TransactionService.prototype._updateMempool = function(tx, action) { TransactionService.prototype.blockHandler = function(block, connectBlock, callback) { var self = this; var action = 'put'; + reverseAction = 'del'; if (!connectBlock) { action = 'del'; + reverseAction = 'put'; } var operations = []; @@ -121,7 +123,7 @@ TransactionService.prototype.blockHandler = function(block, connectBlock, callba }); }, function(next) { async.eachSeries(block.transactions, function(tx, next) { - self._updateMempool(tx, action); + self._updateMempool(tx, reverseAction); tx.__timestamp = block.__timestamp; tx.__height = block.__height;