diff --git a/lib/primitives/coin.js b/lib/primitives/coin.js index 8083548c..6627443a 100644 --- a/lib/primitives/coin.js +++ b/lib/primitives/coin.js @@ -165,11 +165,17 @@ Coin.prototype.inspect = function inspect() { */ Coin.prototype.toJSON = function toJSON() { + var address = this.getAddress(); + + if (address) + address = address.toBase58(); + return { version: this.version, height: this.height, value: utils.btc(this.value), script: this.script.toJSON(), + address: address, coinbase: this.coinbase, hash: this.hash ? utils.revHex(this.hash) : null, index: this.index diff --git a/lib/wallet/walletdb.js b/lib/wallet/walletdb.js index 573a4fdc..6df001dc 100644 --- a/lib/wallet/walletdb.js +++ b/lib/wallet/walletdb.js @@ -1850,7 +1850,7 @@ WalletDB.prototype._removeBlock = co(function* removeBlock(entry) { yield this.setTip(prev); this.logger.warning('Disconnected block %s (tx=%d).', - utils.revHex(block.hash), block.txs.length); + utils.revHex(tip.hash), block.txs.length); return block.txs.length; });