diff --git a/frontend/src/app/components/transactions-list/transactions-list.component.html b/frontend/src/app/components/transactions-list/transactions-list.component.html index 0942ba8a9..08ffb69d4 100644 --- a/frontend/src/app/components/transactions-list/transactions-list.component.html +++ b/frontend/src/app/components/transactions-list/transactions-list.component.html @@ -58,11 +58,11 @@ @if (tx['_showSignatures']) {
- @if (tx['_sigs'][vindex].length === 0 && signaturesMode === 'all') { + @if (!tx['_sigs']?.[vindex]?.length) { - } @else if (showSig(tx['_sigs'][vindex])) { + } @else { @for (sig of tx['_sigs'][vindex].slice(0, 7); track sig.signature; let idx = $index) { @if (idx < 7) { blocks[0])); this.networkSubscription = this.stateService.networkChanged$.subscribe((network) => this.network = network); + this.signaturesSubscription = this.stateService.signaturesMode$.subscribe((mode) => { - this.signaturesMode = mode; + this.signaturesPreference = mode; this.updateSignaturesMode(); }); this.queryParamsSubscription = this.route.queryParams.subscribe((params) => { - console.log('query params', params); if (params['sigs'] && ['all', 'interesting', 'none'].includes(params['sigs'])) { this.signaturesOverride = params['sigs'] as SignaturesMode; this.updateSignaturesMode(); @@ -313,16 +313,19 @@ export class TransactionsListComponent implements OnInit, OnChanges, OnDestroy { } // process signature data - tx['_sigs'] = tx.vin.map(vin => processInputSignatures(vin)); - tx['_sigmap'] = tx['_sigs'].reduce((map, sigs, vindex) => { - sigs.forEach(sig => { - map[sig.signature] = { sig, vindex }; - }); - return map; - }, {}); + if (tx.vin.length && !tx.vin[0].is_coinbase) { + tx['_sigs'] = tx.vin.map(vin => processInputSignatures(vin)); + tx['_sigmap'] = tx['_sigs'].reduce((map, sigs, vindex) => { + sigs.forEach(sig => { + map[sig.signature] = { sig, vindex }; + }); + return map; + }, {}); - if (!tx['_interestingSignatures']) { - tx['_interestingSignatures'] = tx['_sigs'].some(sigs => sigs.some(sig => this.sigIsInteresting(sig))); + if (!tx['_interestingSignatures']) { + tx['_interestingSignatures'] = tx['_sigs'].some(sigs => sigs.some(sig => this.sigIsInteresting(sig))) + || tx['_sigs'].every(sigs => !sigs?.length); + } } tx['_showSignatures'] = this.shouldShowSignatures(tx); } diff --git a/frontend/src/app/services/state.service.ts b/frontend/src/app/services/state.service.ts index 100eeef35..cb98b6dc4 100644 --- a/frontend/src/app/services/state.service.ts +++ b/frontend/src/app/services/state.service.ts @@ -335,7 +335,7 @@ export class StateService { this.blocksSubject$.next([]); }); - this.signaturesMode$ = new BehaviorSubject(this.storageService.getValue('signatures-enabled') as SignaturesMode || null); + this.signaturesMode$ = new BehaviorSubject(this.storageService.getValue('signatures-mode') as SignaturesMode || null); this.blockVSize = this.env.BLOCK_WEIGHT_UNITS / 4; diff --git a/frontend/src/app/shared/transaction.utils.ts b/frontend/src/app/shared/transaction.utils.ts index ecf392ff4..6fa0ff736 100644 --- a/frontend/src/app/shared/transaction.utils.ts +++ b/frontend/src/app/shared/transaction.utils.ts @@ -235,7 +235,7 @@ export function processInputSignatures(vin: Vin): SigInfo[] { signatures = extractDERSignaturesWitness(vin.witness || []); break; case 'v1_p2tr': { - const hasAnnex = vin.witness[vin.witness.length - 1].startsWith('50'); + const hasAnnex = vin.witness.length > 1 &&vin.witness[vin.witness.length - 1].startsWith('50'); const isKeyspend = vin.witness.length === (hasAnnex ? 2 : 1); if (isKeyspend) { signatures = extractSchnorrSignatures(vin.witness);