Skip to content

Commit 5c0655b

Browse files
committed
Consistently log in propose_quiescence
Instead of logging both inside propose_quiescence and at the call site, only log inside it. This simplifies the return type.
1 parent e21a7a5 commit 5c0655b

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

lightning/src/ln/channel.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11905,8 +11905,7 @@ where
1190511905
}
1190611906

1190711907
self.propose_quiescence(logger, QuiescentAction::Splice { contribution, locktime }).map_err(
11908-
|(e, action)| {
11909-
log_error!(logger, "{}", e);
11908+
|action| {
1191011909
// FIXME: Any better way to do this?
1191111910
if let QuiescentAction::Splice { contribution, .. } = action {
1191211911
let (contributed_inputs, contributed_outputs) =
@@ -13046,14 +13045,19 @@ where
1304613045
#[rustfmt::skip]
1304713046
pub fn propose_quiescence<L: Logger>(
1304813047
&mut self, logger: &L, action: QuiescentAction,
13049-
) -> Result<Option<msgs::Stfu>, (&'static str, QuiescentAction)> {
13048+
) -> Result<Option<msgs::Stfu>, QuiescentAction> {
1305013049
log_debug!(logger, "Attempting to initiate quiescence");
1305113050

1305213051
if !self.context.is_usable() {
13053-
return Err(("Channel is not in a usable state to propose quiescence", action));
13052+
log_debug!(logger, "Channel is not in a usable state to propose quiescence");
13053+
return Err(action);
1305413054
}
1305513055
if self.quiescent_action.is_some() {
13056-
return Err(("Channel already has a pending quiescent action and cannot start another", action));
13056+
log_debug!(
13057+
logger,
13058+
"Channel already has a pending quiescent action and cannot start another",
13059+
);
13060+
return Err(action);
1305713061
}
1305813062

1305913063
self.quiescent_action = Some(action);

lightning/src/ln/channelmanager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13239,7 +13239,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
1323913239
});
1324013240
notify = NotifyOption::SkipPersistHandleEvents;
1324113241
},
13242-
Err((msg, _action)) => log_trace!(logger, "{}", msg),
13242+
Err(action) => log_trace!(logger, "Failed to propose quiescence for: {:?}", action),
1324313243
}
1324413244
} else {
1324513245
result = Err(APIError::APIMisuseError {

0 commit comments

Comments
 (0)