From c106b2f75e3214f0e02e152c0db79ada6e34eaa2 Mon Sep 17 00:00:00 2001 From: Ivan Vershigora Date: Thu, 7 Nov 2024 14:25:16 +0000 Subject: [PATCH] fix: update Slashpay config after refreshLdk on CJIT --- src/utils/lightning/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/lightning/index.ts b/src/utils/lightning/index.ts index 9431b12b9..e631d6f0b 100644 --- a/src/utils/lightning/index.ts +++ b/src/utils/lightning/index.ts @@ -536,7 +536,6 @@ export const subscribeToLightningPayments = ({ EEventTypes.new_channel, async (res: TChannelUpdate) => { await updateChannelsThunk(); - updateSlashPayConfig({ selectedWallet, selectedNetwork }); const openChannels = getOpenChannels(); const closedChannels = getClosedChannels(); @@ -553,10 +552,11 @@ export const subscribeToLightningPayments = ({ // Check if this is a CJIT Entry that needs to be added to the activity list. addCJitActivityItem(res.channel_id).then(); - // Refresh to update balance - refreshLdk(); // We need to sync the ledger because TChannelUpdate doesn't have enough data syncLedger(); + // Refresh to update balance + await refreshLdk(); + updateSlashPayConfig({ selectedWallet, selectedNetwork }); }, ); }