fix assert.

This commit is contained in:
Christopher Jeffrey 2016-01-21 02:01:49 -08:00
parent 18f1412ba7
commit 495dda79ef

View File

@ -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;
};