Merge branch 'master' into nymkappa/bugfix/missing-last-data-charts

This commit is contained in:
wiz
2022-08-08 15:59:34 +09:00
committed by GitHub
11 changed files with 55 additions and 58 deletions

View File

@@ -430,10 +430,13 @@ class NetworkSyncService {
}
private toIntegerId(id: string): string {
if (config.LIGHTNING.BACKEND === 'lnd') {
if (config.LIGHTNING.BACKEND === 'cln') {
return convertChannelId(id);
}
else if (config.LIGHTNING.BACKEND === 'lnd') {
return id;
}
return convertChannelId(id);
return '';
}
/** Decodes a channel id returned by lnd as uint64 to a short channel id */

View File

@@ -8,8 +8,8 @@ class LightningStatsUpdater {
public async $startService(): Promise<void> {
logger.info('Starting Lightning Stats service');
// LightningStatsImporter.$run();
this.$runTasks();
await this.$runTasks();
LightningStatsImporter.$run();
}
private setDateMidnight(date: Date): void {
@@ -34,7 +34,7 @@ class LightningStatsUpdater {
const date = new Date();
this.setDateMidnight(date);
logger.info(`Updating latest node stats`);
logger.info(`Updating latest networks stats`);
const networkGraph = await lightningApi.$getNetworkGraph();
LightningStatsImporter.computeNetworkStats(date.getTime() / 1000, networkGraph);
}