Small cleanup
This commit is contained in:
parent
5d7e42195f
commit
d7f2f4136c
@ -151,9 +151,11 @@ class LightningStatsImporter {
|
|||||||
const alreadyCountedChannels = {};
|
const alreadyCountedChannels = {};
|
||||||
|
|
||||||
for (const channel of networkGraph.channels) {
|
for (const channel of networkGraph.channels) {
|
||||||
const tx = await fundingTxFetcher.$fetchChannelOpenTx(channel.scid.slice(0, -2));
|
const short_id = channel.scid.slice(0, -2);
|
||||||
|
|
||||||
|
const tx = await fundingTxFetcher.$fetchChannelOpenTx(short_id);
|
||||||
if (!tx) {
|
if (!tx) {
|
||||||
logger.err(`Unable to fetch funding tx for channel ${channel.scid}. Capacity and creation date will stay unknown.`);
|
logger.err(`Unable to fetch funding tx for channel ${short_id}. Capacity and creation date is unknown. Skipping channel.`);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,10 +177,10 @@ class LightningStatsImporter {
|
|||||||
nodeStats[channel.destination].capacity += Math.round(tx.value * 100000000);
|
nodeStats[channel.destination].capacity += Math.round(tx.value * 100000000);
|
||||||
nodeStats[channel.destination].channels++;
|
nodeStats[channel.destination].channels++;
|
||||||
|
|
||||||
if (!alreadyCountedChannels[channel.scid.slice(0, -2)]) {
|
if (!alreadyCountedChannels[short_id]) {
|
||||||
capacity += Math.round(tx.value * 100000000);
|
capacity += Math.round(tx.value * 100000000);
|
||||||
capacities.push(Math.round(tx.value * 100000000));
|
capacities.push(Math.round(tx.value * 100000000));
|
||||||
alreadyCountedChannels[channel.scid.slice(0, -2)] = true;
|
alreadyCountedChannels[short_id] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
avgFeeRate += channel.fee_proportional_millionths;
|
avgFeeRate += channel.fee_proportional_millionths;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user