diff --git a/lib/bcoin/block.js b/lib/bcoin/block.js index bb39a96f..9fc85d98 100644 --- a/lib/bcoin/block.js +++ b/lib/bcoin/block.js @@ -353,7 +353,7 @@ Block.fromRaw = function fromRaw(data, enc, type) { return new Block(Block._fromRaw(data, enc)); }; -Block.prototype.toSmall = function toSmall() { +Block.prototype.toCompact = function toCompact() { var block = this.abbr(); var height = this.height; var off = 0; @@ -378,7 +378,7 @@ Block.prototype.toSmall = function toSmall() { return buf; }; -Block.fromSmall = function fromSmall(buf) { +Block.fromCompact = function fromCompact(buf) { var tx, txCount, i; var off = 0; var hashes = []; diff --git a/lib/bcoin/blockdb.js b/lib/bcoin/blockdb.js index 5d7ab222..9acfbeab 100644 --- a/lib/bcoin/blockdb.js +++ b/lib/bcoin/blockdb.js @@ -136,7 +136,7 @@ BlockDB.prototype.saveBlock = function saveBlock(block, callback) { var self = this; var batch = this.db.batch(); - batch.put('b/b/' + block.hash('hex'), block.toSmall()); + batch.put('b/b/' + block.hash('hex'), block.toCompact()); block.txs.forEach(function(tx, i) { batch.put('t/t/' + tx.hash('hex'), tx.toExtended()); @@ -528,7 +528,7 @@ BlockDB.prototype.getCoin = function getCoin(hash, index, callback) { } try { - coin = bcoin.coin.fromRaw(data); + coin = bcoin.coin.fromExtended(data); } catch (e) { return callback(e); } @@ -764,7 +764,7 @@ BlockDB.prototype.getBlock = function getBlock(hash, callback) { return callback(err); } - block = bcoin.block.fromSmall(data); + block = bcoin.block.fromCompact(data); block.txs = []; utils.forEach(block.hashes, function(hash, next, i) { diff --git a/lib/bcoin/txdb.js b/lib/bcoin/txdb.js index a6cbc02c..71b7dbcb 100644 --- a/lib/bcoin/txdb.js +++ b/lib/bcoin/txdb.js @@ -1345,7 +1345,7 @@ TXPool.prototype.getCoin = function getCoin(hash, index, callback) { return callback(err); } - return callback(null, bcoin.coin.fromRaw(coin)); + return callback(null, bcoin.coin.fromExtended(coin)); }); };