Skip to content
This repository was archived by the owner on Feb 9, 2026. It is now read-only.

Commit 22b58c6

Browse files
authored
Merge pull request #180 from synonymdev/ios-chain-monitor
fix: reset chain monitor on restart
2 parents d443731 + 75cab48 commit 22b58c6

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

lib/ios/Ldk.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,10 +496,19 @@ class Ldk: NSObject {
496496
//Reset only objects created by initChannelManager
497497
channelManagerConstructor?.interrupt()
498498
channelManagerConstructor = nil
499+
chainMonitor = nil
499500
channelManager = nil
500501
peerManager = nil
501502
peerHandler = nil
502503

504+
chainMonitor = ChainMonitor(
505+
chainSource: filter,
506+
broadcaster: broadcaster,
507+
logger: logger,
508+
feeest: feeEstimator,
509+
persister: persister
510+
)
511+
503512
LdkEventEmitter.shared.send(withEvent: .native_log, body: "Starting LDK background tasks again")
504513
initChannelManager(currentNetwork, blockHash: currentBlockchainTipHash, blockHeight: currentBlockchainHeight) { success in
505514
//Notify JS that a sync is required

0 commit comments

Comments
 (0)