Skip to content

Commit c928209

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 a9c9fa4 commit c928209

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

lightning/src/ln/channel.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11929,8 +11929,7 @@ where
1192911929
}
1193011930

1193111931
self.propose_quiescence(logger, QuiescentAction::Splice { contribution, locktime }).map_err(
11932-
|(e, action)| {
11933-
log_error!(logger, "{}", e);
11932+
|action| {
1193411933
// FIXME: Any better way to do this?
1193511934
if let QuiescentAction::Splice { contribution, .. } = action {
1193611935
let (contributed_inputs, contributed_outputs) =
@@ -13070,14 +13069,19 @@ where
1307013069
#[rustfmt::skip]
1307113070
pub fn propose_quiescence<L: Logger>(
1307213071
&mut self, logger: &L, action: QuiescentAction,
13073-
) -> Result<Option<msgs::Stfu>, (&'static str, QuiescentAction)> {
13072+
) -> Result<Option<msgs::Stfu>, QuiescentAction> {
1307413073
log_debug!(logger, "Attempting to initiate quiescence");
1307513074

1307613075
if !self.context.is_usable() {
13077-
return Err(("Channel is not in a usable state to propose quiescence", action));
13076+
log_debug!(logger, "Channel is not in a usable state to propose quiescence");
13077+
return Err(action);
1307813078
}
1307913079
if self.quiescent_action.is_some() {
13080-
return Err(("Channel already has a pending quiescent action and cannot start another", action));
13080+
log_debug!(
13081+
logger,
13082+
"Channel already has a pending quiescent action and cannot start another",
13083+
);
13084+
return Err(action);
1308113085
}
1308213086

1308313087
self.quiescent_action = Some(action);

lightning/src/ln/channelmanager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13276,7 +13276,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
1327613276
});
1327713277
notify = NotifyOption::SkipPersistHandleEvents;
1327813278
},
13279-
Err((msg, _action)) => log_trace!(logger, "{}", msg),
13279+
Err(action) => log_trace!(logger, "Failed to propose quiescence for: {:?}", action),
1328013280
}
1328113281
} else {
1328213282
result = Err(APIError::APIMisuseError {

0 commit comments

Comments
 (0)