Skip to content

Commit 72fa9ab

Browse files
committed
Introduce Documentation and other minor fixes
1 parent 63eaff3 commit 72fa9ab

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9416,15 +9416,15 @@ where
94169416
}
94179417
}
94189418

9419-
impl<M: Deref, BI: Deref, ES: Deref, NS: Deref, SP: Deref, FE: Deref, R: Deref, L: Deref>
9420-
OffersMessageHandler for ChannelManager<M, BI, ES, NS, SP, FE, R, L>
9419+
impl<M: Deref, T: Deref, ES: Deref, NS: Deref, SP: Deref, F: Deref, R: Deref, L: Deref>
9420+
OffersMessageHandler for ChannelManager<M, T, ES, NS, SP, F, R, L>
94219421
where
94229422
M::Target: chain::Watch<<SP::Target as SignerProvider>::EcdsaSigner>,
9423-
BI::Target: BroadcasterInterface,
9423+
T::Target: BroadcasterInterface,
94249424
ES::Target: EntropySource,
94259425
NS::Target: NodeSigner,
94269426
SP::Target: SignerProvider,
9427-
FE::Target: FeeEstimator,
9427+
F::Target: FeeEstimator,
94289428
R::Target: Router,
94299429
L::Target: Logger,
94309430
{
@@ -9546,7 +9546,6 @@ where
95469546
None
95479547
},
95489548
};
9549-
95509549
if let Some(response) = response_option {
95519550
responder.respond(response)
95529551
} else {

lightning/src/onion_message/messenger.rs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,14 @@ impl OnionMessageRecipient {
244244
}
245245
}
246246

247-
/// A enum to handle received [`OnionMessage`]
247+
/// The `ReceivedOnionMessage` enum represents messages received by the `OnionMessageHandler`.
248+
///
249+
/// This enum encompasses two variants:
250+
/// - `WithReplyPath`: Represents a message that can be responded to, including the original message,
251+
/// an optional path id, and a responder.
252+
/// - `WithoutReplyPath`: Represents a message without the possibility of response because of absence of a reply_path.
253+
/// It contains the original message and an optional path id.
254+
///
248255
pub enum ReceivedOnionMessage<T>
249256
where
250257
T: OnionMessageContents
@@ -284,15 +291,15 @@ where
284291
}
285292
}
286293

287-
/// A struct handling response to an [`OnionMessage`]
294+
/// The `Responder` struct manages responses to [`ReceivedOnionMessage`]
288295
pub struct Responder<T>
289296
where
290297
T: OnionMessageContents
291298
{
292299
reply_path: BlindedPath,
293300

294-
// This phantom Data is used to ensure that we use T in the struct definition
295-
// This allow us to ensure at compile time that the received message type and response type will be same
301+
/// A marker field, ensuring compile-time enforcement that the message
302+
/// type used in the struct definition matches the response type.
296303
_phantom: PhantomData<T>
297304
}
298305

@@ -308,6 +315,11 @@ where
308315
}
309316
}
310317

318+
/// The `ResponseInstruction` enum represents instructions for responding to [`ReceivedOnionMessage`].
319+
///
320+
/// It includes the following variants:
321+
/// - `HaveResponse`: Indicates that a response is available, and can be sent using reply_path.
322+
/// - `NoResponse`: Indicates that no response is available.
311323
pub enum ResponseInstruction<T: OnionMessageContents> {
312324
HaveResponse {
313325
response: T,

0 commit comments

Comments
 (0)