From 75cab486db7a74a1a6deba674eb9afd8ebe0868a Mon Sep 17 00:00:00 2001 From: Jason Date: Fri, 13 Oct 2023 12:51:19 +0200 Subject: [PATCH] fix: reset chain monitor on restart --- lib/ios/Ldk.swift | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/ios/Ldk.swift b/lib/ios/Ldk.swift index 61aeb150..32dd50a5 100644 --- a/lib/ios/Ldk.swift +++ b/lib/ios/Ldk.swift @@ -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