Find inactive channels with dead nodes.

This commit is contained in:
softsimon
2022-05-03 20:18:07 +04:00
parent 65c731e1ad
commit 7e1c2f4f40
9 changed files with 56 additions and 24 deletions

View File

@@ -3,17 +3,23 @@
<table class="table table-borderless">
<thead>
<th class="alias text-left" i18n="nodes.alias">Node Alias</th>
<th class="alias text-left" i18n="channels.transaction">Node ID</th>
<th class="alias text-left" i18n="nodes.alias">Status</th>
<th class="channels text-right" i18n="channels.rate">Fee Rate</th>
<th class="capacity text-right" i18n="channels.id">Channel ID</th>
<th class="capacity text-right" i18n="nodes.capacity">Capacity</th>
<th class="alias text-right" i18n="channels.transaction">Transaction ID</th>
<th class="capacity text-right" i18n="channels.id">Channel ID</th>
</thead>
<tbody *ngIf="channels$ | async as channels; else skeleton">
<tr *ngFor="let channel of channels; let i = index;">
<ng-template [ngIf]="channel.node2_public_key === publicKey" [ngIfElse]="right">
<td class="alias text-left">
<a [routerLink]="['/lightning/node' | relativeUrl, channel.node1_public_key]">{{ channel.alias_left }}</a>
{{ channel.alias_left || '?' }}
</td>
<td class="text-left">
<a [routerLink]="['/lightning/node' | relativeUrl, channel.node1_public_key]">
<span>{{ channel.node1_public_key | shortenString : 10 }}</span>
</a>
<app-clipboard [text]="channel.node1_public_key"></app-clipboard>
</td>
<td>
<span class="badge rounded-pill badge-secondary" *ngIf="channel.status === 0">Inactive</span>
@@ -25,8 +31,14 @@
</td>
</ng-template>
<ng-template #right>
<td class="alias text-left" *ngIf="channel.node1_public_key === publicKey">
<a [routerLink]="['/lightning/node' | relativeUrl, channel.node2_public_key]">{{ channel.alias_right }}</a>
<td class="alias text-left">
{{ channel.alias_right || '?' }}
</td>
<td class="text-left">
<a [routerLink]="['/lightning/node' | relativeUrl, channel.node2_public_key]">
<span>{{ channel.node2_public_key | shortenString : 10 }}</span>
</a>
<app-clipboard [text]="channel.node2_public_key"></app-clipboard>
</td>
<td>
<span class="badge rounded-pill badge-secondary" *ngIf="channel.status === 0">Inactive</span>
@@ -37,23 +49,20 @@
{{ channel.node2_fee_rate / 10000 | number }}%
</td>
</ng-template>
<td class="capacity text-right">
<a [routerLink]="['/lightning/channel' | relativeUrl, channel.id]">{{ channel.id }}</a>
</td>
<td class="capacity text-right">
<app-amount [satoshis]="channel.capacity" digitsInfo="1.2-2"></app-amount>
</td>
<td class="text-right">
<a [routerLink]="['/tx' | relativeUrl, channel.transaction_id + ':' + channel.transaction_vout]" >
<span>{{ channel.transaction_id | shortenString : 10 }}</span>
</a>
<app-clipboard [text]="channel.transaction_id"></app-clipboard>
</td>
<td class="capacity text-right">
<a [routerLink]="['/lightning/channel' | relativeUrl, channel.id]">{{ channel.id }}</a>
</td>
</tr>
</tbody>
<ng-template #skeleton>
<tbody>
<tr *ngFor="let item of [1,2,3,4,5,6,7,8,9,10]">
<td class="alias text-left" style="width: 370px;">
<span class="skeleton-loader"></span>
</td>
<td class="alias text-left">
<span class="skeleton-loader"></span>
</td>