|
|
@ -834,6 +834,17 @@ TransactionBuilder.prototype.toObj = function() { |
|
|
|
return ret; |
|
|
|
}; |
|
|
|
|
|
|
|
TransactionBuilder.prototype._setScriptSig = function(inScriptSig) { |
|
|
|
this.vanilla.scriptSig = inScriptSig; |
|
|
|
|
|
|
|
for (var i in inScriptSig) { |
|
|
|
this.tx.ins[i].s = new Buffer(inScriptSig[i], 'hex'); |
|
|
|
var scriptSig = new Script(this.tx.ins[i].s); |
|
|
|
if (scriptSig.finishedMultiSig() !== false) |
|
|
|
this.inputsSigned++; |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
// fromObj
|
|
|
|
// -------
|
|
|
|
// Returns a TransactionBuilder instance given
|
|
|
@ -855,12 +866,8 @@ TransactionBuilder.fromObj = function(data) { |
|
|
|
if (data.outs) { |
|
|
|
b.setOutputs(data.outs); |
|
|
|
|
|
|
|
for (var i in data.scriptSig) { |
|
|
|
b.tx.ins[i].s = new Buffer(data.scriptSig[i], 'hex'); |
|
|
|
|
|
|
|
var scriptSig = new Script(b.tx.ins[i].s); |
|
|
|
if (scriptSig.finishedMultiSig() !== false) |
|
|
|
b.inputsSigned++; |
|
|
|
if (data.scriptSig) { |
|
|
|
b._setScriptSig(data.scriptSig); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|