sighash: remove dead branch

This commit is contained in:
Daniel Cousens 2015-04-27 18:49:45 +10:00
parent 86089355ad
commit 05a8cf9630
1 changed files with 1 additions and 4 deletions

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;