|
@ -12,6 +12,8 @@ var Hash = require('../crypto/hash'); |
|
|
var Sighash = require('./sighash'); |
|
|
var Sighash = require('./sighash'); |
|
|
var Signature = require('../crypto/signature'); |
|
|
var Signature = require('../crypto/signature'); |
|
|
|
|
|
|
|
|
|
|
|
var errors = require('../errors'); |
|
|
|
|
|
|
|
|
var Address = require('../address'); |
|
|
var Address = require('../address'); |
|
|
var Unit = require('../unit'); |
|
|
var Unit = require('../unit'); |
|
|
var Input = require('./input'); |
|
|
var Input = require('./input'); |
|
@ -176,6 +178,7 @@ Transaction.prototype.from = function(utxo, pubkeys, threshold) { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
Transaction.prototype._fromMultiSigP2SH = function(utxo, pubkeys, threshold) { |
|
|
Transaction.prototype._fromMultiSigP2SH = function(utxo, pubkeys, threshold) { |
|
|
|
|
|
throw new errors.NotImplemented('Transaction#_fromMultiSigP2SH'); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
Transaction.prototype._fromNonP2SH = function(utxo) { |
|
|
Transaction.prototype._fromNonP2SH = function(utxo) { |
|
@ -275,6 +278,7 @@ Transaction.prototype.to = function() { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
Transaction.prototype._payToMultisig = function(pubkeys, threshold, amount) { |
|
|
Transaction.prototype._payToMultisig = function(pubkeys, threshold, amount) { |
|
|
|
|
|
throw new errors.NotImplemented('Transaction#_payToMultisig'); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
Transaction.prototype._payToAddress = function(address, amount) { |
|
|
Transaction.prototype._payToAddress = function(address, amount) { |
|
@ -344,7 +348,13 @@ Transaction.prototype._getPrivateKeySignatures = function(privKey) { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
Transaction.prototype.applySignature = function(signature) { |
|
|
Transaction.prototype.applySignature = function(signature) { |
|
|
this.inputs[signature.inputIndex].setScript(Script.buildPublicKeyHashIn(signature)); |
|
|
this.inputs[signature.inputIndex].setScript( |
|
|
|
|
|
Script.buildPublicKeyHashIn( |
|
|
|
|
|
signature.publicKey, |
|
|
|
|
|
signature.signature.toDER(), |
|
|
|
|
|
signature.sigtype |
|
|
|
|
|
) |
|
|
|
|
|
); |
|
|
return this; |
|
|
return this; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|