From 642bad0c0dadb78e05be8803775e3e64d3ffbadb Mon Sep 17 00:00:00 2001 From: Otto Allmendinger Date: Tue, 12 Dec 2023 13:58:48 +0100 Subject: [PATCH] chore: move comment about forkId to the right place Issue: BTC-0 --- modules/utxo-lib/src/bitgo/UtxoTransaction.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/utxo-lib/src/bitgo/UtxoTransaction.ts b/modules/utxo-lib/src/bitgo/UtxoTransaction.ts index dc47900e9a..650193a500 100644 --- a/modules/utxo-lib/src/bitgo/UtxoTransaction.ts +++ b/modules/utxo-lib/src/bitgo/UtxoTransaction.ts @@ -61,6 +61,11 @@ export class UtxoTransaction extends b } addForkId(hashType: number): number { + /* + ``The sighash type is altered to include a 24-bit fork id in its most significant bits.'' + We also use unsigned right shift operator `>>>` to cast to UInt32 + https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Unsigned_right_shift + */ if (hashType & UtxoTransaction.SIGHASH_FORKID) { const forkId = isBitcoinGold(this.network) ? 79 : 0; return (hashType | (forkId << 8)) >>> 0; @@ -100,11 +105,6 @@ export class UtxoTransaction extends b const addForkId = (hashType & UtxoTransaction.SIGHASH_FORKID) > 0; if (addForkId) { - /* - ``The sighash type is altered to include a 24-bit fork id in its most significant bits.'' - We also use unsigned right shift operator `>>>` to cast to UInt32 - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Unsigned_right_shift - */ if (value === undefined) { throw new Error(`must provide value`); }