Skip to content

Commit

Permalink
fix: update Slashpay config after refreshLdk on CJIT
Browse files Browse the repository at this point in the history
  • Loading branch information
limpbrains committed Nov 7, 2024
1 parent 7114a47 commit c106b2f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/lightning/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,6 @@ export const subscribeToLightningPayments = ({
EEventTypes.new_channel,
async (res: TChannelUpdate) => {
await updateChannelsThunk();
updateSlashPayConfig({ selectedWallet, selectedNetwork });

const openChannels = getOpenChannels();
const closedChannels = getClosedChannels();
Expand All @@ -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 });
},
);
}
Expand Down

0 comments on commit c106b2f

Please sign in to comment.