Merge pull request #1200 from dcousens/patch-1

sighash: remove dead branch
This commit is contained in:
Manuel Aráoz 2015-04-27 13:36:59 -03:00
commit c53b9861d3

View File

@ -62,12 +62,9 @@ var sighash = function sighash(transaction, sighashType, inputNumber, subscript)
} else if ((sighashType & 31) === Signature.SIGHASH_SINGLE) {
// The SIGHASH_SINGLE bug.
// https://bitcointalk.org/index.php?topic=260595.0
if (inputNumber > txcopy.outputs.length - 1) {
if (inputNumber >= txcopy.outputs.length) {
return new Buffer(SIGHASH_SINGLE_BUG, 'hex');
}
if (txcopy.outputs.length <= inputNumber) {
throw new Error('Missing output to sign');
}
txcopy.outputs.length = inputNumber + 1;