Save latest node channel update in node.updated_at field in db

This commit is contained in:
nymkappa
2022-08-31 09:37:19 +02:00
parent 1766169ba7
commit 207a2eb9b6
2 changed files with 20 additions and 0 deletions

View File

@@ -63,6 +63,9 @@ class NetworkSyncService {
let deletedSockets = 0;
const graphNodesPubkeys: string[] = [];
for (const node of nodes) {
const latestUpdated = await channelsApi.$getLatestChannelUpdateForNode(node.pub_key);
node.last_update = Math.max(node.last_update, latestUpdated);
await nodesApi.$saveNode(node);
graphNodesPubkeys.push(node.pub_key);
++progress;