diff --git a/lib/bcoin/chain.js b/lib/bcoin/chain.js index f7b77d4e..38bcd569 100644 --- a/lib/bcoin/chain.js +++ b/lib/bcoin/chain.js @@ -824,7 +824,7 @@ ChainDB.prototype.save = function save(entry) { raw = entry.toRaw(); offset = entry.height * BLOCK_SIZE; - return this._writeSync(raw, offset); + return this._write(raw, offset); }; // This causes weird race conditions with size/count/tip. @@ -853,7 +853,7 @@ ChainDB.prototype.saveAsync = function save(entry, callback) { raw = entry.toRaw(); offset = entry.height * BLOCK_SIZE; - return this._write(raw, offset, function(err, success) { + return this._writeAsync(raw, offset, function(err, success) { var item = self._queue[entry.height]; assert(item); @@ -862,7 +862,7 @@ ChainDB.prototype.saveAsync = function save(entry, callback) { // Synchronously write it and get it over with. try { if (item !== entry) - success = self._writeSync(item.toRaw(), offset); + success = self._write(item.toRaw(), offset); } catch (e) { err = e; } @@ -885,7 +885,7 @@ ChainDB.prototype.saveAsync = function save(entry, callback) { ChainDB.prototype.del = function del(height) { assert(height >= 0); - this._writeSync(this._nullBlock, height * BLOCK_SIZE); + this._write(this._nullBlock, height * BLOCK_SIZE); // If we deleted several blocks at the end, go back // to the last non-null block and truncate the file @@ -929,7 +929,7 @@ ChainDB.prototype._read = function _read(size, offset) { } }; -ChainDB.prototype._write = function _write(data, offset, callback) { +ChainDB.prototype._writeAsync = function _writeAsync(data, offset, callback) { var self = this; var size = data.length; var index = 0; @@ -956,7 +956,7 @@ ChainDB.prototype._write = function _write(data, offset, callback) { })(); }; -ChainDB.prototype._writeSync = function _writeSync(data, offset) { +ChainDB.prototype._write = function _write(data, offset) { var size = data.length; var index = 0; var bytes;