diff --git a/lib/bcoin/chaindb.js b/lib/bcoin/chaindb.js index 4adb94a2..49f110cc 100644 --- a/lib/bcoin/chaindb.js +++ b/lib/bcoin/chaindb.js @@ -561,8 +561,8 @@ ChainDB.prototype.save = function save(entry, block, view, connect, callback) { height.writeUInt32LE(height, 0, true); - batch.put(layout.h(entry.hash), height); - batch.put(layout.e(entry.hash), entry.toRaw()); + batch.put(layout.h(hash), height); + batch.put(layout.e(hash), entry.toRaw()); this.cacheHash.set(entry.hash, entry); @@ -1413,7 +1413,7 @@ ChainDB.prototype.getUndoView = function getUndoView(block, callback) { if (err) return callback(err); - return self.getUndoCoins(block.hash('hex'), function(err, coins) { + return self.getUndoCoins(block.hash(), function(err, coins) { if (err) return callback(err);