From 397764ece6cbf8aee7215a403ce94f30ef1ef1db Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Wed, 13 Jan 2016 18:40:51 -0800 Subject: [PATCH] input and output redeem script. --- lib/bcoin/input.js | 8 ++++++-- lib/bcoin/output.js | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/bcoin/input.js b/lib/bcoin/input.js index 554d4beb..e2587c75 100644 --- a/lib/bcoin/input.js +++ b/lib/bcoin/input.js @@ -74,7 +74,7 @@ Input.prototype.__defineGetter__('signature', function() { }); Input.prototype.__defineGetter__('key', function() { - return this.data.redeem || this.keys[0]; + return this.keys[0]; }); Input.prototype.__defineGetter__('hash', function() { @@ -101,6 +101,10 @@ Input.prototype.__defineGetter__('addresses', function() { return this.data.addresses || []; }); +Input.prototype.__defineGetter__('redeem', function() { + return this.data.redeem; +}); + Input.prototype.__defineGetter__('scriptaddress', function() { return this.data.scriptaddress; }); @@ -358,7 +362,7 @@ Input.prototype.inspect = function inspect() { lock: this.lock, value: utils.btc(output.value), script: bcoin.script.format(this.script)[0], - redeem: this.data.redeem ? bcoin.script.format(this.data.redeem)[0] : null, + redeem: this.redeem ? bcoin.script.format(this.redeem)[0] : null, seq: this.seq, output: output }; diff --git a/lib/bcoin/output.js b/lib/bcoin/output.js index 98539ec2..bf706439 100644 --- a/lib/bcoin/output.js +++ b/lib/bcoin/output.js @@ -65,7 +65,7 @@ Output.prototype.__defineGetter__('signature', function() { }); Output.prototype.__defineGetter__('key', function() { - return this.data.redeem || this.keys[0]; + return this.keys[0]; }); Output.prototype.__defineGetter__('hash', function() {