From 65d34b35e54d2aad3793459664fa7e4d76f12624 Mon Sep 17 00:00:00 2001 From: Mononaut Date: Sat, 12 Jul 2025 04:15:58 +0000 Subject: [PATCH] fix frontend goggles annex detection --- frontend/src/app/shared/transaction.utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/shared/transaction.utils.ts b/frontend/src/app/shared/transaction.utils.ts index 615b9cc89..c511d6802 100644 --- a/frontend/src/app/shared/transaction.utils.ts +++ b/frontend/src/app/shared/transaction.utils.ts @@ -634,8 +634,8 @@ export function getTransactionFlags(tx: Transaction, cpfpInfo?: CpfpInfo, replac // created before taproot activation don't need to have any witness data // (see https://mempool.space/tx/b10c007c60e14f9d087e0291d4d0c7869697c6681d979c6639dbd960792b4d41) if (vin.witness?.length) { - // in taproot, if the last witness item begins with 0x50, it's an annex - const hasAnnex = vin.witness?.[vin.witness.length - 1].startsWith('50'); + // in taproot, if there are at least two witness elements, and the first byte of the last element is 0x50, that last element is an annex + const hasAnnex = vin.witness?.length > 1 && vin.witness?.[vin.witness.length - 1].startsWith('50'); // script spends have more than one witness item, not counting the annex (if present) if (vin.witness.length > (hasAnnex ? 2 : 1)) { // the script itself is the second-to-last witness item, not counting the annex