REF: Channel size GUI

This commit is contained in:
ncoelho
2021-02-17 17:29:22 +01:00
committed by Overtorment
parent 36ae5c5f4e
commit 5457d377f3
3 changed files with 9 additions and 4 deletions

View File

@@ -26,13 +26,14 @@ function updateLightning() {
lightningListChannels = response;
let channels = [];
for (let channel of lightningListChannels.channels) {
let magic = 104287;
let divider = 0.01;
let max = 100;
let ascii_length1 = channel.local_balance * divider;
let ascii_length2 = channel.remote_balance * divider;
channel.local = (Math.round(ascii_length1));
channel.remote = (max - (Math.round(ascii_length1)));
channel.total = ((channel.local) + (channel.remote);
channel.remote = (Math.round(ascii_length2));
channel.total = (channel.local) + (channel.remote);
channel.size = (channel.capacity / magic);
channel.capacity_btc = channel.capacity / 100000000;
channel.name = pubkey2name[channel.remote_pubkey];
if (channel.name) {