You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BackupClient.addToPersistQueue(.channelMonitor(id: channelIdHex), data.write()){ error in
41
-
iflet error {
42
-
LdkEventEmitter.shared.send(withEvent:.native_log, body:"Error. Failed persist channel on remote server (\(channelIdHex)). \(error.localizedDescription)")
43
-
return
44
-
}
45
-
46
-
// Callback for when the persist queue queue entry is processed
// Notify chain monitor on main thread to avoid threading issues
36
+
DispatchQueue.main.async{
37
+
letres=Ldk.chainMonitor?.channelMonitorUpdated(
38
+
fundingTxo: channelFundingOutpoint,
39
+
completedUpdateId: data.getLatestUpdateId()
40
+
)
57
41
iflet error = res?.getError(){
58
42
LdkEventEmitter.shared.send(withEvent:.native_log, body:"Error. Failed to update chain monitor for channel (\(channelIdHex)) Error \(error.getValueType()).")
59
43
}else{
@@ -63,10 +47,19 @@ class LdkPersister: Persist {
63
47
}
64
48
}
65
49
}
66
-
67
-
returnChannelMonitorUpdateStatus.InProgress
50
+
51
+
// Kick off remote backup asynchronously; log but never block/skip local persist
52
+
if !BackupClient.skipRemoteBackup {
53
+
BackupClient.addToPersistQueue(.channelMonitor(id: channelIdHex),[UInt8](serialized)){ error in
54
+
iflet error {
55
+
LdkEventEmitter.shared.send(withEvent:.native_log, body:"Error. Failed persist channel on remote server (\(channelIdHex)). \(error.localizedDescription)")
56
+
}
57
+
}
58
+
}
59
+
60
+
returnChannelMonitorUpdateStatus.Completed
68
61
}catch{
69
-
LdkEventEmitter.shared.send(withEvent:.native_log, body:"Error. Failed to persist channel (\(channelIdHex)) to disk Error \(error.localizedDescription).")
62
+
LdkEventEmitter.shared.send(withEvent:.native_log, body:"Error. Failed to locally persist channel (\(channelIdHex)). \(error.localizedDescription)")
0 commit comments