diff --git a/lib/wallet/txdb.js b/lib/wallet/txdb.js index 441d34cd..ba98acc5 100644 --- a/lib/wallet/txdb.js +++ b/lib/wallet/txdb.js @@ -1919,6 +1919,7 @@ TXDB.prototype.getAccountBalance = co(function* getBalance(account) { TXDB.prototype.zap = co(function* zap(account, age) { var hashes = []; + var now = utils.now(); var i, txs, tx, hash; if (!utils.isUInt32(age)) @@ -1926,7 +1927,7 @@ TXDB.prototype.zap = co(function* zap(account, age) { txs = yield this.getRange(account, { start: 0, - end: utils.now() - age + end: now - age }); for (i = 0; i < txs.length; i++) { @@ -1936,6 +1937,8 @@ TXDB.prototype.zap = co(function* zap(account, age) { if (tx.ts !== 0) continue; + assert(now - tx.ps >= age); + this.wallet.start(); this.logger.debug('Zapping TX: %s (%s)',