Enable offline mode when previewing coinbase

This commit is contained in:
natsoni
2025-04-09 13:01:10 +02:00
parent be2c57e020
commit 17cc2ded4c
3 changed files with 6 additions and 4 deletions

View File

@@ -220,7 +220,7 @@
<thead> <thead>
<tr> <tr>
<th class="data-title clip text-center coinbase" i18n="latest-blocks.coinbasetag"> <th class="data-title clip text-center coinbase" i18n="latest-blocks.coinbasetag">
<a class="title-link" [routerLink]="['/tx/preview' | relativeUrl]" [fragment]="'hex=' + job.coinbase"> <a class="title-link" [routerLink]="['/tx/preview' | relativeUrl]" [fragment]="'offline=true&hex=' + job.coinbase">
Coinbase tag <span>&nbsp;</span> Coinbase tag <span>&nbsp;</span>
<fa-icon [icon]="['fas', 'external-link-alt']" [fixedWidth]="true" style="vertical-align: text-top; font-size: 13px; color: var(--title-fg)"></fa-icon> <fa-icon [icon]="['fas', 'external-link-alt']" [fixedWidth]="true" style="vertical-align: text-top; font-size: 13px; color: var(--title-fg)"></fa-icon>
</a> </a>

View File

@@ -45,7 +45,7 @@
<app-amount [satoshis]="row.job.reward"></app-amount> <app-amount [satoshis]="row.job.reward"></app-amount>
</td> </td>
<td class="height"> <td class="height">
<a [routerLink]="['/tx/preview' | relativeUrl]" [fragment]="'hex=' + row.job.coinbase"> <a [routerLink]="['/tx/preview' | relativeUrl]" [fragment]="'offline=true&hex=' + row.job.coinbase">
{{ row.job.height }} {{ row.job.height }}
</a> </a>
</td> </td>

View File

@@ -86,12 +86,14 @@ export class TransactionRawComponent implements OnInit, OnDestroy {
const hex = params.get('hex'); const hex = params.get('hex');
if (hex) { if (hex) {
this.pushTxForm.get('txRaw').setValue(hex); this.pushTxForm.get('txRaw').setValue(hex);
this.decodeTransaction();
} }
const offline = params.get('offline'); const offline = params.get('offline');
if (offline) { if (offline) {
this.offlineMode = offline === 'true'; this.offlineMode = offline === 'true';
} }
if (this.pushTxForm.get('txRaw').value) {
this.decodeTransaction();
}
} }
}); });
} }
@@ -281,7 +283,6 @@ export class TransactionRawComponent implements OnInit, OnDestroy {
this.filters = []; this.filters = [];
this.hasPrevouts = false; this.hasPrevouts = false;
this.missingPrevouts = []; this.missingPrevouts = [];
this.offlineMode = false;
this.stateService.markBlock$.next({}); this.stateService.markBlock$.next({});
this.mempoolBlocksSubscription?.unsubscribe(); this.mempoolBlocksSubscription?.unsubscribe();
this.broadcastSubscription?.unsubscribe(); this.broadcastSubscription?.unsubscribe();
@@ -290,6 +291,7 @@ export class TransactionRawComponent implements OnInit, OnDestroy {
resetForm() { resetForm() {
this.resetState(); this.resetState();
this.pushTxForm.get('txRaw').setValue(''); this.pushTxForm.get('txRaw').setValue('');
this.offlineMode = false;
this.router.navigate([], { this.router.navigate([], {
fragment: '', fragment: '',
replaceUrl: true replaceUrl: true