diff --git a/lib/bcoin/input.js b/lib/bcoin/input.js index f7b4eeac..eba9ce51 100644 --- a/lib/bcoin/input.js +++ b/lib/bcoin/input.js @@ -25,8 +25,11 @@ function Input(options, tx) { this.witness = bcoin.script.witness(options.witness); this._mutable = !tx || (tx instanceof bcoin.mtx); - if (options.coin) + if (options.coin) { this.coin = bcoin.coin(options.coin); + assert(typeof this.coin.hash === 'string'); + assert(typeof this.coin.index === 'number'); + } if (Buffer.isBuffer(this.prevout.hash)) this.prevout.hash = utils.toHex(this.prevout.hash); @@ -153,7 +156,7 @@ Input.prototype.inspect = function inspect() { var coin; if (this.coin) { - coin = this.coin.inspect(); + coin = this.coin; } else { coin = { type: 'unknown',