Transaction: rename script -> prevOutScript
This commit is contained in:
parent
66636f56bb
commit
a2d581dec5
1 changed files with 5 additions and 5 deletions
|
@ -312,15 +312,15 @@ Transaction.prototype.setInputScript = function(index, script) {
|
|||
this.ins[index].script = script
|
||||
}
|
||||
|
||||
// FIXME: should probably be validateInput(index, pub)
|
||||
Transaction.prototype.validateInput = function(index, script, pub, DERsig) {
|
||||
// FIXME: could be validateInput(index, prevTxOut, pub)
|
||||
Transaction.prototype.validateInput = function(index, prevOutScript, pubKey, DERsig) {
|
||||
var type = DERsig.readUInt8(DERsig.length - 1)
|
||||
DERsig = DERsig.slice(0, -1)
|
||||
|
||||
var hash = this.hashForSignature(script, index, type)
|
||||
var sig = ecdsa.parseSig(DERsig)
|
||||
var hash = this.hashForSignature(prevOutScript, index, type)
|
||||
var signature = ecdsa.parseSig(DERsig)
|
||||
|
||||
return pub.verify(hash, sig)
|
||||
return pubKey.verify(hash, signature)
|
||||
}
|
||||
|
||||
Transaction.feePerKb = 20000
|
||||
|
|
Loading…
Reference in a new issue