cd959a74dc53cc0e176a25e175735011aea6a8ec
[rust-lightning] / lightning / src / ln / mod.rs
1 // This file is Copyright its original authors, visible in version control
2 // history.
3 //
4 // This file is licensed under the Apache License, Version 2.0 <LICENSE-APACHE
5 // or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
6 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
7 // You may not use this file except in accordance with one or both of these
8 // licenses.
9
10 //! High level lightning structs and impls live here.
11 //!
12 //! You probably want to create a channelmanager::ChannelManager, and a routing::NetGraphMsgHandler first.
13 //! Then, you probably want to pass them both on to a peer_handler::PeerManager and use that to
14 //! create/manage connections and call get_and_clear_pending_events after each action, handling
15 //! them appropriately.
16 //!
17 //! When you want to open/close a channel or send a payment, call into your ChannelManager and when
18 //! you want to learn things about the network topology (eg get a route for sending a payment),
19 //! call into your NetGraphMsgHandler.
20
21 pub mod channelmanager;
22 pub mod msgs;
23 pub mod peer_handler;
24 pub mod chan_utils;
25 pub mod features;
26 pub(crate) mod onchaintx;
27
28 #[cfg(feature = "fuzztarget")]
29 pub mod peer_channel_encryptor;
30 #[cfg(not(feature = "fuzztarget"))]
31 pub(crate) mod peer_channel_encryptor;
32
33 mod channel;
34 mod onion_utils;
35 mod wire;
36
37 // Older rustc (which we support) refuses to let us call the get_payment_preimage_hash!() macro
38 // without the node parameter being mut. This is incorrect, and thus newer rustcs will complain
39 // about an unnecessary mut. Thus, we silence the unused_mut warning in two test modules below.
40
41 #[cfg(test)]
42 #[macro_use]
43 pub(crate) mod functional_test_utils;
44 #[cfg(test)]
45 #[allow(unused_mut)]
46 mod functional_tests;
47 #[cfg(test)]
48 #[allow(unused_mut)]
49 mod chanmon_update_fail_tests;
50 #[cfg(test)]
51 mod reorg_tests;
52 #[cfg(test)]
53 #[allow(unused_mut)]
54 mod onion_route_tests;
55
56 pub use self::peer_channel_encryptor::LN_MAX_MSG_LEN;