coin: better json.
This commit is contained in:
parent
9dcd366d15
commit
d8006cb9df
@ -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
|
||||
|
||||
@ -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;
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user