Commit graph

415 commits

Author SHA1 Message Date
Matt Corallo
922fc8e9ee Avoid use std and use std::fmt and fmt:: instead in network_graph
This is more consistent with the way we use std::cmp over the
codebase and avoids `use std`, which is only actually needed to
support older rustcs, so feels a bit awkward.
2020-06-22 17:42:35 -04:00
Matt Corallo
c33a444267 Reduce RwLock usage in public interface of NetworkGraph
This isn't a big difference in the API, but it avoids needing to
wrap a given NetworkGraph in a RwLock before passing it, which
makes it much easier to generate C bindings for.
2020-06-22 13:42:28 -04:00
Valentine Wallace
87126b391b
ChannelManager+Router++ Logger Arc --> Deref
This caused a bunch of cascading changes, including
passing loggers down to Channels in function calls
rather than having each Channel have a pointer to the
ChannelManager's Logger (which was a circular reference).
Other structs that the Channel had passed its Logger to also
had their loggers removed. Other newly unused Loggers were
also removed, especially when keeping them would've caused
a bunch of extra test changes to be necessary, e.g. with
the ChainWatchInterfaceUtil's Logger.
2020-05-17 12:33:43 -04:00
Matt Corallo
b1c80970e9 Fix some new indentation nits 2020-05-12 14:16:43 -04:00
Matt Corallo
6e1aa6cab5 Fix a few new (and one old) issues in the new channel_update
We need to always set lowest_inbound_channel_fees to None if there
are no channels (and we should ignore the channels which are
disabled for the purpose of lowest-fee calculations). Further, we
cannot unwrap the channel lookups as they may be for channels which
are not related to the channel we are processing an update for.
Finally, we can satisfy borrowck much easier since things are on
self instead of on a MutexGuard.
2020-05-12 14:02:40 -04:00
Matt Corallo
57ac2ec1b6 Add missing comment on why last_update_message is None 2020-05-12 14:02:40 -04:00
Matt Corallo
0e3bf19b66 Move get_addresses to network_graph and drop now-useless log_trace
Because we expose the internals we don't need a method to log
their contents anymore, and get_addresses can now avoid copying as
we expose the RwLock directly
2020-05-12 14:02:40 -04:00
Gleb Naumenko
07a7e34f89 Improve routing-related documentation 2020-05-12 09:27:12 -04:00
Gleb Naumenko
7ec98e6206 Remove NetGraphMsgHandler serialization 2020-05-12 09:27:11 -04:00
Gleb Naumenko
8467223a5d Make DirectionalChannelInfo optional 2020-05-12 09:27:11 -04:00
Gleb Naumenko
afd4282107 Move node announcement fields into a separate struct 2020-05-12 09:27:11 -04:00
Gleb Naumenko
a7e193241c Expose some network graph methods 2020-05-12 09:27:11 -04:00
Gleb Naumenko
e553d2c2c0 Split routing from getting network messages 2020-05-12 09:27:11 -04:00
Gleb Naumenko
6164a95267 Remove non-bitcoin chain helpers 2020-05-12 09:27:11 -04:00
Gleb Naumenko
5bd7f24634 Move router to a separate module 2020-05-12 09:27:11 -04:00