From 3d9d6be23c3cc3edd8fc7caef830d1e74fc60253 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Mon, 7 Dec 2015 11:04:23 -0800 Subject: [PATCH] use this.m for nsigs. --- lib/bcoin/tx.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/bcoin/tx.js b/lib/bcoin/tx.js index a1523c80..2d77ca7e 100644 --- a/lib/bcoin/tx.js +++ b/lib/bcoin/tx.js @@ -42,8 +42,8 @@ function TX(data, block) { // ps = Pending Since this.ps = this.ts === 0 ? +new Date() / 1000 : 0; - this.m = data.m || 1; - this.n = data.n || 1; + this.m = data.m; + this.n = data.n; this.change = data.change || null; this.fee = data.fee || 10000; this.dust = 5460; @@ -153,6 +153,7 @@ TX.prototype.scriptInput = function(input, pub, nsigs) { // Multisig // raw format: OP_FALSE [sig-1] [sig-2] ... if (bcoin.script.isMultisig(s)) { + nsigs = nsigs || this.m; if (!nsigs) throw new Error('`nsigs` is required for multisig'); input.script = [ constants.opcodes['false'] ];