diff --git a/lib/bcoin/tx.js b/lib/bcoin/tx.js index 2a3b7907..43e3fb08 100644 --- a/lib/bcoin/tx.js +++ b/lib/bcoin/tx.js @@ -597,11 +597,12 @@ TX.prototype.signatureHash = function signatureHash(index, s, type) { type = constants.hashType[type]; assert(type != null); + assert(index < copy.inputs.length) // bitcoind used to return 1 as an error code: // it ended up being treated like a hash. - if (index >= copy.inputs.length) - return constants.oneHash.slice(); + // if (index >= copy.inputs.length) + // return constants.oneHash.slice(); copy.inputs.forEach(function(input, i) { input.script = i === index ? s : [];