]> git.bitcoin.ninja Git - rust-lightning/commit
2/3 Use `MessageSendInstructions` instead of `PendingOnionMessage`
authorMatt Corallo <git@bluematt.me>
Thu, 22 Aug 2024 01:42:55 +0000 (01:42 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 22 Aug 2024 22:27:47 +0000 (22:27 +0000)
commiteecaf1487990f132ce4ca7b750eabb43a7207525
tree395a03496074525b8e4ec5d49b4ac58d5dab9cb2
parent90361c18bf709fa2d2f148ff375351fda7528c98
2/3 Use `MessageSendInstructions` instead of `PendingOnionMessage`

Now that the `MessageRouter` can `create_blinded_paths` forcing
callers of the `OnionMessenger` to provide it with a reply path up
front is unnecessary complexity, doubly so in message handlers.

Here we take the next step towards untangling that, moving from
`PendingOnionMessage` to `MessageSendInstructions` for the outbound
message queue in `OffersMessageHandler`. Better, we can also drop
the `c_bindings`-specific message queue variant, unifying the APIs.

Because `ChannelManager` needs to actually control the reply path
set in individual messages, however, we have to halfway this patch,
adding a new `MessageSendInstructions` variant that allows
specifying the `reply_path` explicitly. Still, because other message
handlers are moving this way, its nice to be consistent.
lightning/src/ln/channelmanager.rs
lightning/src/ln/offers_tests.rs
lightning/src/onion_message/messenger.rs
lightning/src/onion_message/offers.rs