This commit is contained in:
Christopher Jeffrey 2016-04-05 05:04:54 -07:00
parent 141dbcb65e
commit 1afb9dbc27

View File

@ -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',