You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RUSTFLAGS="$RUSTFLAGS -A unused_variables -A unused_macros -A unused_imports -A dead_code" cargo check -p lightning --verbose --color always --features "$FEATURE"
Copy file name to clipboardExpand all lines: lightning-rapid-gossip-sync/src/lib.rs
+20-6
Original file line number
Diff line number
Diff line change
@@ -35,8 +35,15 @@
35
35
//! Note that the first ever rapid sync should use `0` for `last_sync_timestamp`.
36
36
//!
37
37
//! After the gossip data snapshot has been downloaded, one of the client's graph processing
38
-
//! functions needs to be called. In this example, we process the update by reading its contents
39
-
//! from disk, which we do by calling [`RapidGossipSync::update_network_graph`]:
38
+
//! functions needs to be called.
39
+
#![cfg_attr(
40
+
feature = "std",
41
+
doc = "In this example, we process the update by reading its contents from disk, which we do by calling [`RapidGossipSync::update_network_graph`]:"
42
+
)]
43
+
#![cfg_attr(
44
+
not(feature = "std"),
45
+
doc = "In this example, we process the update by reading its contents from disk, which we do by calling [`RapidGossipSync::update_network_graph_no_std`]:"
46
+
)]
40
47
//!
41
48
//! ```
42
49
//! use bitcoin::constants::genesis_block;
@@ -54,10 +61,17 @@
54
61
//! let network_graph = NetworkGraph::new(Network::Bitcoin, &logger);
55
62
//! let rapid_sync = RapidGossipSync::new(&network_graph, &logger);
56
63
//! let snapshot_contents: &[u8] = &[0; 0];
57
-
//! // In no-std you need to provide the current time in unix epoch seconds
58
-
//! // otherwise you can use update_network_graph
59
-
//! let current_time_unix = 0;
60
-
//! let new_last_sync_timestamp_result = rapid_sync.update_network_graph_no_std(snapshot_contents, Some(current_time_unix));
64
+
//! // In non-`std` environments you need to provide the current time in unix epoch seconds
65
+
//! // otherwise you can use `update_network_graph`:
/// This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
66
-
/// available and the current time is supplied by the caller.
64
+
#[cfg_attr(feature = "std", doc = "")]
65
+
#[cfg_attr(feature = "std", doc = "This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not available and the current time is supplied by the caller.")]
/// This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
122
-
/// available and the current time is supplied by the caller.
119
+
#[cfg_attr(feature = "std", doc = "")]
120
+
#[cfg_attr(feature = "std", doc = "This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not available and the current time is supplied by the caller.")]
/// See [`create_invoice_from_channelmanager_with_description_hash`]
403
-
/// This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
404
-
/// available and the current time is supplied by the caller.
400
+
/// Utility to construct an invoice. Generally, unless you want to do something like a custom
401
+
/// `cltv_expiry`, this is what you should be using to create an invoice.
402
+
#[cfg_attr(feature = "std", doc = "")]
403
+
#[cfg_attr(feature = "std", doc = "See [`create_invoice_from_channelmanager_with_description_hash`] for more information.")]
404
+
#[cfg_attr(feature = "std", doc = "")]
405
+
#[cfg_attr(feature = "std", doc = "This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not available and the current time is supplied by the caller.")]
/// This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
429
-
/// available and the current time is supplied by the caller.
428
+
/// Utility to construct an invoice. Generally, unless you want to do something like a custom
429
+
/// `cltv_expiry`, this is what you should be using to create an invoice.
430
+
#[cfg_attr(feature = "std", doc = "")]
431
+
#[cfg_attr(feature = "std", doc = "See [`create_invoice_from_channelmanager`] for more information.")]
432
+
#[cfg_attr(feature = "std", doc = "")]
433
+
#[cfg_attr(feature = "std", doc = "This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not available and the current time is supplied by the caller.")]
0 commit comments