txdb: zap assert.
This commit is contained in:
parent
eee6866319
commit
1b489f42cd
@ -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)',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user