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) {
|
TXDB.prototype.zap = co(function* zap(account, age) {
|
||||||
var hashes = [];
|
var hashes = [];
|
||||||
|
var now = utils.now();
|
||||||
var i, txs, tx, hash;
|
var i, txs, tx, hash;
|
||||||
|
|
||||||
if (!utils.isUInt32(age))
|
if (!utils.isUInt32(age))
|
||||||
@ -1926,7 +1927,7 @@ TXDB.prototype.zap = co(function* zap(account, age) {
|
|||||||
|
|
||||||
txs = yield this.getRange(account, {
|
txs = yield this.getRange(account, {
|
||||||
start: 0,
|
start: 0,
|
||||||
end: utils.now() - age
|
end: now - age
|
||||||
});
|
});
|
||||||
|
|
||||||
for (i = 0; i < txs.length; i++) {
|
for (i = 0; i < txs.length; i++) {
|
||||||
@ -1936,6 +1937,8 @@ TXDB.prototype.zap = co(function* zap(account, age) {
|
|||||||
if (tx.ts !== 0)
|
if (tx.ts !== 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
assert(now - tx.ps >= age);
|
||||||
|
|
||||||
this.wallet.start();
|
this.wallet.start();
|
||||||
|
|
||||||
this.logger.debug('Zapping TX: %s (%s)',
|
this.logger.debug('Zapping TX: %s (%s)',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user