-
Notifications
You must be signed in to change notification settings - Fork 418
Introduce SendOnlyMessageHandler
trait
#3922
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce SendOnlyMessageHandler
trait
#3922
Conversation
I've assigned @joostjager as a reviewer! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not much to comment on here.
👋 The first review has been submitted! Do you think this PR is ready for a second reviewer? If so, click here to assign a second reviewer. |
Previously, we introduced a new `send_only_message_handler: BaseMessageHandler` field to `MessageHandler`, which we expect to only ever be implemented by `ChainMonitor`. However, given that more objects implement `BaseMessageHandler`, the API allowed to plugin different objects, such as `ChannelManager`, resulting in unexpected behavior. Here, we resolve this by introducing a new super trait `SendOnlyMessageHandler` that is only implemented by `ChainMonitor`.
3da1368
to
1e99cdb
Compare
Force-pushed the following fixup: > git diff-tree -U2 3da136849 1e99cdbdd
diff --git a/lightning/src/ln/msgs.rs b/lightning/src/ln/msgs.rs
index 8a7febe4c..da5cdf7c9 100644
--- a/lightning/src/ln/msgs.rs
+++ b/lightning/src/ln/msgs.rs
@@ -2180,5 +2180,5 @@ pub trait OnionMessageHandler: BaseMessageHandler {
/// A handler which can only be used to send messages.
///
-/// This is mostly implemented by [`ChainMonitor`].
+/// This is implemented by [`ChainMonitor`].
///
/// [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor |
Given we recently decided to more often merge with 1 review for simple changes, I'm going to land this. |
Previously, we introduced a new
send_only_message_handler: BaseMessageHandler
field toMessageHandler
, which we expect to only ever be implemented byChainMonitor
.However, given that more objects implement
BaseMessageHandler
, the API allowed to plugin different objects, such asChannelManager
, resulting in unexpected behavior.Here, we resolve this by introducing a new super trait
SendOnlyMessageHandler
that is only implemented byChainMonitor
.(cc @adi2011)