Browse Source

TransactionBuilder: fixMultisigOrder only works if a redeemScript exists

hk-custom-address
Daniel Cousens 8 years ago
committed by Daniel Cousens
parent
commit
6056e7913e
  1. 9
      src/transaction_builder.js

9
src/transaction_builder.js

@ -213,17 +213,12 @@ function prepareInput (input, kpPubKey, redeemScript, hashType) {
}
function fixMultisigOrder (input, transaction, vin) {
var hashScriptType = input.redeemScriptType || input.prevOutType
if (hashScriptType !== 'multisig') return
var hashScript = input.redeemScript || input.prevOutScript
if (!hashScript) return
if (!input.pubKeys) return
if (input.redeemScriptType !== 'multisig' || !input.redeemScript) return
if (input.pubKeys.length === input.signatures.length) return
var unmatched = input.signatures.concat()
var hashType = input.hashType || Transaction.SIGHASH_ALL
var hash = transaction.hashForSignature(vin, hashScript, hashType)
var hash = transaction.hashForSignature(vin, input.redeemScript, hashType)
input.signatures = input.pubKeys.map(function (pubKey, y) {
var keyPair = ECPair.fromPublicKeyBuffer(pubKey)

Loading…
Cancel
Save