From d585a416b78c3605bd833393d2f2d0c8fb65c3ac Mon Sep 17 00:00:00 2001 From: Evan Kaloudis Date: Mon, 27 Nov 2023 17:03:14 -0500 Subject: [PATCH] isLightningReadyToReceive: quit calling getNodeInfo once synced to chain --- stores/NodeInfoStore.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/stores/NodeInfoStore.ts b/stores/NodeInfoStore.ts index a2dad3fa6..08fab57b3 100644 --- a/stores/NodeInfoStore.ts +++ b/stores/NodeInfoStore.ts @@ -113,8 +113,11 @@ export default class NodeInfoStore { @action public isLightningReadyToReceive = async () => { await this.channelsStore.getChannels(); - await this.getNodeInfo(); - const syncedToChain = this.nodeInfo?.synced_to_chain; + let syncedToChain = this.nodeInfo?.synced_to_chain; + if (!syncedToChain) { + await this.getNodeInfo(); + syncedToChain = this.nodeInfo?.synced_to_chain; + } return ( syncedToChain &&