Skip to content

Commit a8fa5a1

Browse files
authored
Merge pull request #2591 from TheBlueMatt/2023-09-2562-followups
Doc and comment followups to #2562
2 parents 6016101 + 34dd48c commit a8fa5a1

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

lightning-persister/src/fs_store.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ mod tests {
436436
}
437437

438438
// Test that if the store's path to channel data is read-only, writing a
439-
// monitor to it results in the store returning an InProgress.
439+
// monitor to it results in the store returning an UnrecoverableError.
440440
// Windows ignores the read-only flag for folders, so this test is Unix-only.
441441
#[cfg(not(target_os = "windows"))]
442442
#[test]
@@ -458,7 +458,7 @@ mod tests {
458458
let update_id = update_map.get(&added_monitors[0].0.to_channel_id()).unwrap();
459459

460460
// Set the store's directory to read-only, which should result in
461-
// returning a permanent failure when we then attempt to persist a
461+
// returning an unrecoverable failure when we then attempt to persist a
462462
// channel update.
463463
let path = &store.get_data_dir();
464464
let mut perms = fs::metadata(path).unwrap().permissions();

lightning/src/chain/chainmonitor.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ impl MonitorUpdateId {
9898
/// If at some point no further progress can be made towards persisting the pending updates, the
9999
/// node should simply shut down.
100100
///
101-
/// * If the persistence has failed and cannot be retried further (e.g. because of some timeout),
101+
/// * If the persistence has failed and cannot be retried further (e.g. because of an outage),
102102
/// [`ChannelMonitorUpdateStatus::UnrecoverableError`] can be used, though this will result in
103103
/// an immediate panic and future operations in LDK generally failing.
104104
///
@@ -113,7 +113,10 @@ impl MonitorUpdateId {
113113
/// [`ChainMonitor::channel_monitor_updated`] must be called once for *each* update which occurs.
114114
///
115115
/// If at some point no further progress can be made towards persisting a pending update, the node
116-
/// should simply shut down.
116+
/// should simply shut down. Until then, the background task should either loop indefinitely, or
117+
/// persistence should be regularly retried with [`ChainMonitor::list_pending_monitor_updates`]
118+
/// and [`ChainMonitor::get_monitor`] (note that if a full monitor is persisted all pending
119+
/// monitor updates may be marked completed).
117120
///
118121
/// # Using remote watchtowers
119122
///

lightning/src/ln/channelmanager.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -3471,9 +3471,8 @@ where
34713471
/// In general, a path may raise:
34723472
/// * [`APIError::InvalidRoute`] when an invalid route or forwarding parameter (cltv_delta, fee,
34733473
/// node public key) is specified.
3474-
/// * [`APIError::ChannelUnavailable`] if the next-hop channel is not available for updates
3475-
/// (including due to previous monitor update failure or new permanent monitor update
3476-
/// failure).
3474+
/// * [`APIError::ChannelUnavailable`] if the next-hop channel is not available as it has been
3475+
/// closed, doesn't exist, or the peer is currently disconnected.
34773476
/// * [`APIError::MonitorUpdateInProgress`] if a new monitor update failure prevented sending the
34783477
/// relevant updates.
34793478
///

lightning/src/ln/shutdown_tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ fn shutdown_on_unfunded_channel() {
264264
nodes[0].node.create_channel(nodes[1].node.get_our_node_id(), 1_000_000, 100_000, 0, None).unwrap();
265265
let open_chan = get_event_msg!(nodes[0], MessageSendEvent::SendOpenChannel, nodes[1].node.get_our_node_id());
266266

267-
// P2WSH
267+
// Create a dummy P2WPKH script
268268
let script = Builder::new().push_int(0)
269269
.push_slice(&[0; 20])
270270
.into_script();

0 commit comments

Comments
 (0)