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

@@ -52,7 +52,7 @@
<div class="row row-cols-1 row-cols-md-2">
<div class="col">
<div class="mb-2">
<h2 class="mb-0">{{ channel.alias_left }}</h2>
<h2 class="mb-0">{{ channel.alias_left || '?' }}</h2>
<a [routerLink]="['/lightning/node' | relativeUrl, channel.node1_public_key]" >
{{ channel.node1_public_key | shortenString : 18 }}
</a>
@@ -96,7 +96,7 @@
</div>
<div class="col">
<div class="mb-2">
<h2 class="mb-0">{{ channel.alias_right }}</h2>
<h2 class="mb-0">{{ channel.alias_right || '?' }}</h2>
<a [routerLink]="['/lightning/node' | relativeUrl, channel.node2_public_key]" >
{{ channel.node2_public_key | shortenString : 18 }}
</a>

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>

View File

@@ -3,7 +3,7 @@
<div class="item">
<h5 class="card-title" i18n="mining.average-fee">Capacity</h5>
<div class="card-text" i18n-ngbTooltip="mining.average-fee"
ngbTooltip="Fee paid on average for each transaction in the past 144 blocks" placement="bottom">
ngbTooltip="Percentage change past week" placement="bottom">
<app-amount [satoshis]="statistics.latest.total_capacity" digitsInfo="1.2-2"></app-amount>
<span class="fiat">
<app-change [current]="statistics.latest.total_capacity" [previous]="statistics.previous.total_capacity"></app-change>
@@ -13,7 +13,7 @@
<div class="item">
<h5 class="card-title" i18n="mining.rewards">Nodes</h5>
<div class="card-text" i18n-ngbTooltip="mining.rewards-desc"
ngbTooltip="Amount being paid to miners in the past 144 blocks" placement="bottom">
ngbTooltip="Percentage change past week" placement="bottom">
<div class="fee-text">
{{ statistics.latest.node_count | number }}
</div>
@@ -25,7 +25,7 @@
<div class="item">
<h5 class="card-title" i18n="mining.rewards-per-tx">Channels</h5>
<div class="card-text" i18n-ngbTooltip="mining.rewards-per-tx-desc"
ngbTooltip="Average miners' reward per transaction in the past 144 blocks" placement="bottom">
ngbTooltip="Percentage change past week" placement="bottom">
<div class="fee-text">
{{ statistics.latest.channel_count | number }}
</div>