Corrected mempool removal logic.
This commit is contained in:
parent
7662bf1bf5
commit
d42e29ecbe
@ -102,8 +102,10 @@ TransactionService.prototype._updateMempool = function(tx, action) {
|
|||||||
TransactionService.prototype.blockHandler = function(block, connectBlock, callback) {
|
TransactionService.prototype.blockHandler = function(block, connectBlock, callback) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var action = 'put';
|
var action = 'put';
|
||||||
|
reverseAction = 'del';
|
||||||
if (!connectBlock) {
|
if (!connectBlock) {
|
||||||
action = 'del';
|
action = 'del';
|
||||||
|
reverseAction = 'put';
|
||||||
}
|
}
|
||||||
|
|
||||||
var operations = [];
|
var operations = [];
|
||||||
@ -121,7 +123,7 @@ TransactionService.prototype.blockHandler = function(block, connectBlock, callba
|
|||||||
});
|
});
|
||||||
}, function(next) {
|
}, function(next) {
|
||||||
async.eachSeries(block.transactions, function(tx, next) {
|
async.eachSeries(block.transactions, function(tx, next) {
|
||||||
self._updateMempool(tx, action);
|
self._updateMempool(tx, reverseAction);
|
||||||
tx.__timestamp = block.__timestamp;
|
tx.__timestamp = block.__timestamp;
|
||||||
tx.__height = block.__height;
|
tx.__height = block.__height;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user