Corrected mempool removal logic.

This commit is contained in:
Chris Kleeschulte 2017-01-24 16:47:13 -05:00
parent 7662bf1bf5
commit d42e29ecbe

View File

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