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-6Lines changed: 20 additions & 6 deletions
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`:
0 commit comments