Replace `EventsProvider` on `OnionMessageHandler` with a single fn
authorMatt Corallo <git@bluematt.me>
Sun, 17 Dec 2023 19:43:28 +0000 (19:43 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 23 Jan 2024 19:55:39 +0000 (19:55 +0000)
`OnionMessageHandler`s are expected to regularly release a set of
nodes which we need to directly connect to to deliver onion
messages. In order to do so, they currently extend
`EventsProvider`, returning that set as `Event::ConnectionNeeded`s.

While this works fine in Rust, the `EventsProvider` interface
doesn't map well in bindings due to it taking a flexible trait impl
as a method argument.

Instead, here, we convert `OnionMessageHandler` to include a single
function which returns nodes in the form of a `node_id` and
`Vec<SocketAddress>`. This is a bit simpler, if less flexible, API,
and while largely equivalent, is easier to map in bindings.


No differences found