From 36f88b398f27a1b377f4b21aae80ec47269affee Mon Sep 17 00:00:00 2001 From: Sky Young Date: Sat, 20 Oct 2018 11:32:12 -0600 Subject: [PATCH] Create segwit signature hash with floData included :) --- lib/primitives/tx.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/primitives/tx.js b/lib/primitives/tx.js index 6bb7752d..d836a7e4 100644 --- a/lib/primitives/tx.js +++ b/lib/primitives/tx.js @@ -711,6 +711,15 @@ TX.prototype.signatureHashV1 = function signatureHashV1(index, prev, value, type bw.writeU32(input.sequence); bw.writeBytes(outputs); bw.writeU32(this.locktime); + + var fOmitTxComment = !!(type & hashType.OMIT_TX_COMMENT); + + if (this.version >= 2 && !fOmitTxComment) { + bw.writeVarBytes(Buffer.from(this.strFloData)); + } + + type &= ~hashType.OMIT_TX_COMMENT; + bw.writeU32(type); return digest.hash256(bw.render());