-
Notifications
You must be signed in to change notification settings - Fork 1
Description
What happened?
When an on-chain transaction is sent to the wallet and a block is mined before the next LDK sync picks up the unconfirmed tx, the "received transaction" sheet/notification does not appear. The balance updates correctly and the activity list shows the transaction, but the user gets no visual feedback that funds arrived.
This happens because LDK Node only fires onchainTransactionConfirmed (skipping onchainTransactionReceived) when the tx goes straight to confirmed. The notification is only wired to the onchainTransactionReceived case in AppViewModel.swift, while onchainTransactionConfirmed only logs — it never checks whether the user was already notified.
Expected behavior
The "received transaction" sheet should appear whenever a new incoming on-chain transaction is detected, regardless of whether it was first seen in the mempool or directly as confirmed.
Steps to Reproduce
- Create a new wallet on regtest
- Copy the wallet's on-chain address
- Send BTC to that address from an external wallet (e.g. via bitcoin-cli)
- Immediately mine a block (before the app's next sync cycle)
- Observe: balance updates, activity list shows the tx, but no "received" notification/sheet appears
Logs / Screenshots / Recordings
Reproduced on iOS simulator. The system log confirms the same pattern as Android — the tx appears only as onchainTransactionConfirmed, with no prior onchainTransactionReceived event.
2026-02-20-missing-received-notification-logs.zip
Bitkit Version
master (d973871)
Device / OS
iPhone 17 Simulator, iOS 26.0
Reproducibility
Always
Additional context
- New wallet on regtest
- On-chain related
- Environment: Regtest (network electrum)
- On mainnet this is very unlikely because the ~10 min block interval gives periodic sync time to see the unconfirmed tx first, but it's theoretically possible if the app is backgrounded/offline during the brief window between broadcast and confirmation
- The same issue exists on Android (filed separately)
- Relevant code:
AppViewModel.swift— theonchainTransactionConfirmedcase (line ~828) only logs, whileonchainTransactionReceived(lines ~805-827) shows the receivedTx sheet - Fix: the
onchainTransactionConfirmedhandler should also check whether the tx was already notified and, if not, show the received sheet - Same as android: no received transaction notification when tx confirms without being seen in mempool bitkit-android#797