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
Simplify in_flight_monitor_updates from Option<HashMap> to HashMap
Since there is no semantic difference between None and Some(empty map)
for in_flight_monitor_updates, simplify the type to HashMap and use
unwrap_or_default() when reading from TLV fields.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
let mut peer_state = peer_state_mutex.lock().unwrap();
18317
-
handle_in_flight_updates!(
18318
-
counterparty_id,
18319
-
chan_in_flight_updates,
18320
-
monitor,
18321
-
peer_state,
18322
-
logger,
18323
-
"closed "
18324
-
);
18325
-
} else {
18326
-
log_error!(logger, "A ChannelMonitor is missing even though we have in-flight updates for it! This indicates a potentially-critical violation of the chain::Watch API!");
18327
-
log_error!(
18328
-
logger,
18329
-
" The ChannelMonitor for channel {} is missing.",
18330
-
channel_id
18331
-
);
18332
-
log_error!(logger, " The chain::Watch API *requires* that monitors are persisted durably before returning,");
18333
-
log_error!(logger, " client applications must ensure that ChannelMonitor data is always available and the latest to avoid funds loss!");
18334
-
log_error!(logger, " Without the latest ChannelMonitor we cannot continue without risking funds.");
18335
-
log_error!(logger, " Please ensure the chain::Watch API requirements are met and file a bug report at https://github.com/lightningdevkit/rust-lightning");
18336
-
log_error!(
18337
-
logger,
18338
-
" Pending in-flight updates are: {:?}",
18339
-
chan_in_flight_updates
18340
-
);
18341
-
return Err(DecodeError::InvalidValue);
18342
-
}
18303
+
for ((counterparty_id, channel_id), mut chan_in_flight_updates) in in_flight_monitor_updates
let mut peer_state = peer_state_mutex.lock().unwrap();
18315
+
handle_in_flight_updates!(
18316
+
counterparty_id,
18317
+
chan_in_flight_updates,
18318
+
monitor,
18319
+
peer_state,
18320
+
logger,
18321
+
"closed "
18322
+
);
18323
+
} else {
18324
+
log_error!(logger, "A ChannelMonitor is missing even though we have in-flight updates for it! This indicates a potentially-critical violation of the chain::Watch API!");
18325
+
log_error!(logger, " The ChannelMonitor for channel {} is missing.", channel_id);
18326
+
log_error!(logger, " The chain::Watch API *requires* that monitors are persisted durably before returning,");
18327
+
log_error!(logger, " client applications must ensure that ChannelMonitor data is always available and the latest to avoid funds loss!");
18328
+
log_error!(
18329
+
logger,
18330
+
" Without the latest ChannelMonitor we cannot continue without risking funds."
18331
+
);
18332
+
log_error!(logger, " Please ensure the chain::Watch API requirements are met and file a bug report at https://github.com/lightningdevkit/rust-lightning");
0 commit comments