Browse Source

TxBuilder: missing redeemScript not an issue if already added

If the input is initialized, we already have the redeemScript, no need
to pass it in again
hk-custom-address
Daniel Cousens 10 years ago
parent
commit
b55e3a0245
  1. 7
      src/transaction_builder.js

7
src/transaction_builder.js

@ -289,13 +289,6 @@ TransactionBuilder.prototype.sign = function(index, privKey, redeemScript, hashT
// are we already initialized?
if (input.initialized) {
if (input.prevOutType === 'scripthash') {
assert(input.redeemScript, 'PrevOutScript is P2SH, missing redeemScript')
} else {
assert(!input.redeemScript, 'PrevOutScript must be P2SH')
}
// redeemScript only needed to initialize, but if provided again, enforce consistency
if (redeemScript) {
assert.deepEqual(input.redeemScript, redeemScript, 'Inconsistent redeemScript')

Loading…
Cancel
Save