From ad4c7e81c809bda68157cae402cee9347930c89d Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Fri, 1 Sep 2017 18:05:50 -0700 Subject: [PATCH] tx: minor. --- lib/primitives/tx.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/primitives/tx.js b/lib/primitives/tx.js index 2849e039..231f0bbb 100644 --- a/lib/primitives/tx.js +++ b/lib/primitives/tx.js @@ -665,9 +665,11 @@ TX.prototype.signatureHashV1 = function signatureHashV1(index, prev, value, type if (!this.mutable) this._hashOutputs = outputs; } - } else if ((type & 0x1f) === hashType.SINGLE && index < this.outputs.length) { - const output = this.outputs[index]; - outputs = digest.hash256(output.toRaw()); + } else if ((type & 0x1f) === hashType.SINGLE) { + if (index < this.outputs.length) { + const output = this.outputs[index]; + outputs = digest.hash256(output.toRaw()); + } } const size = 156 + prev.getVarSize();