Removes applyMultisigs and adds setScriptSig

This commit is contained in:
Daniel Cousens 2014-04-23 05:31:24 +10:00
parent 960d931010
commit 9af8d95daf

View file

@ -319,8 +319,9 @@ Transaction.prototype.sign = function(index, key, type, network) {
var script = Script.createOutputScript(address, network) var script = Script.createOutputScript(address, network)
var hash = this.hashTransactionForSignature(script, index, type) var hash = this.hashTransactionForSignature(script, index, type)
var sig = key.sign(hash).concat([type]) var sig = key.sign(hash).concat([type])
var scriptSig = Script.createInputScript(sig, key.pub)
this.ins[index].script = Script.createInputScript(sig, key.pub) this.setScriptSig(index, scriptSig)
} }
// Takes outputs of the form [{ output: 'txhash:index', address: 'address' },...] // Takes outputs of the form [{ output: 'txhash:index', address: 'address' },...]
@ -369,10 +370,8 @@ Transaction.prototype.p2shsign = function(index, script, key, type) {
return sig return sig
} }
Transaction.prototype.multisign = Transaction.prototype.p2shsign Transaction.prototype.setScriptSig = function(index, script) {
this.ins[index].script = script
Transaction.prototype.applyMultisigs = function(index, script, sigs/*, type*/) {
this.ins[index].script = Script.createMultiSigInputScript(sigs, script)
} }
Transaction.prototype.validateSig = function(index, script, sig, pub) { Transaction.prototype.validateSig = function(index, script, sig, pub) {