fix assert.
This commit is contained in:
parent
18f1412ba7
commit
495dda79ef
@ -735,6 +735,9 @@ ChainDB.prototype._init = function _init() {
|
||||
}
|
||||
|
||||
this.size = this.getSize();
|
||||
|
||||
assert(this.size % BLOCK_SIZE === 0);
|
||||
|
||||
this.fd = fs.openSync(this.file, 'r+');
|
||||
};
|
||||
|
||||
@ -764,7 +767,7 @@ ChainDB.prototype.getSize = function getSize() {
|
||||
|
||||
ChainDB.prototype.count = function count() {
|
||||
var len = this.size / BLOCK_SIZE;
|
||||
assert(len === (len | 0));
|
||||
assert(len % 1 === 0);
|
||||
return len;
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user