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
This commit is contained in:
Daniel Cousens 2015-02-04 20:06:21 +11:00
parent 8a8f40e903
commit b55e3a0245

View file

@ -289,13 +289,6 @@ TransactionBuilder.prototype.sign = function(index, privKey, redeemScript, hashT
// are we already initialized? // are we already initialized?
if (input.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 // redeemScript only needed to initialize, but if provided again, enforce consistency
if (redeemScript) { if (redeemScript) {
assert.deepEqual(input.redeemScript, redeemScript, 'Inconsistent redeemScript') assert.deepEqual(input.redeemScript, redeemScript, 'Inconsistent redeemScript')