sighash work

This commit is contained in:
Christopher Jeffrey 2016-01-13 19:41:03 -08:00
parent 397764ece6
commit 8ade973b31

View File

@ -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 : [];