Skip to content

Commit

Permalink
Merge pull request #180 from synonymdev/ios-chain-monitor
Browse files Browse the repository at this point in the history
fix: reset chain monitor on restart
  • Loading branch information
Jasonvdb authored Oct 13, 2023
2 parents d443731 + 75cab48 commit 22b58c6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/ios/Ldk.swift
Original file line number Diff line number Diff line change
Expand Up @@ -496,10 +496,19 @@ class Ldk: NSObject {
//Reset only objects created by initChannelManager
channelManagerConstructor?.interrupt()
channelManagerConstructor = nil
chainMonitor = nil
channelManager = nil
peerManager = nil
peerHandler = nil

chainMonitor = ChainMonitor(
chainSource: filter,
broadcaster: broadcaster,
logger: logger,
feeest: feeEstimator,
persister: persister
)

LdkEventEmitter.shared.send(withEvent: .native_log, body: "Starting LDK background tasks again")
initChannelManager(currentNetwork, blockHash: currentBlockchainTipHash, blockHeight: currentBlockchainHeight) { success in
//Notify JS that a sync is required
Expand Down

0 comments on commit 22b58c6

Please sign in to comment.