Skip to content

Commit 20916b7

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 96b9e6a commit 20916b7

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
@@ -12214,8 +12214,7 @@ where
1221412214
}
1221512215

1221612216
self.propose_quiescence(logger, QuiescentAction::Splice { contribution, locktime }).map_err(
12217-
|(e, action)| {
12218-
log_error!(logger, "{}", e);
12217+
|action| {
1221912218
// FIXME: Any better way to do this?
1222012219
if let QuiescentAction::Splice { contribution, .. } = action {
1222112220
let (contributed_inputs, contributed_outputs) =
@@ -13355,14 +13354,19 @@ where
1335513354
#[rustfmt::skip]
1335613355
pub fn propose_quiescence<L: Logger>(
1335713356
&mut self, logger: &L, action: QuiescentAction,
13358-
) -> Result<Option<msgs::Stfu>, (&'static str, QuiescentAction)> {
13357+
) -> Result<Option<msgs::Stfu>, QuiescentAction> {
1335913358
log_debug!(logger, "Attempting to initiate quiescence");
1336013359

1336113360
if !self.context.is_usable() {
13362-
return Err(("Channel is not in a usable state to propose quiescence", action));
13361+
log_debug!(logger, "Channel is not in a usable state to propose quiescence");
13362+
return Err(action);
1336313363
}
1336413364
if self.quiescent_action.is_some() {
13365-
return Err(("Channel already has a pending quiescent action and cannot start another", action));
13365+
log_debug!(
13366+
logger,
13367+
"Channel already has a pending quiescent action and cannot start another",
13368+
);
13369+
return Err(action);
1336613370
}
1336713371

1336813372
self.quiescent_action = Some(action);

lightning/src/ln/channelmanager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13401,7 +13401,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
1340113401
});
1340213402
notify = NotifyOption::SkipPersistHandleEvents;
1340313403
},
13404-
Err((msg, _action)) => log_trace!(logger, "{}", msg),
13404+
Err(action) => log_trace!(logger, "Failed to propose quiescence for: {:?}", action),
1340513405
}
1340613406
} else {
1340713407
result = Err(APIError::APIMisuseError {

0 commit comments

Comments
 (0)