Skip to content

Commit 9a86f6b

Browse files
committed
Add network field to NodeStatus
1 parent 147247a commit 9a86f6b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ use bitcoin::BlockHash;
122122
pub use bitcoin::FeeRate;
123123
#[cfg(not(feature = "uniffi"))]
124124
use bitcoin::FeeRate;
125-
use bitcoin::{Address, Amount};
125+
use bitcoin::{Address, Amount, Network};
126126
#[cfg(feature = "uniffi")]
127127
pub use builder::ArcedNodeBuilder as Builder;
128128
pub use builder::BuildError;
@@ -761,6 +761,7 @@ impl Node {
761761
/// Returns the status of the [`Node`].
762762
pub fn status(&self) -> NodeStatus {
763763
let is_running = *self.is_running.read().expect("lock");
764+
let network = self.config.network;
764765
let current_best_block = self.channel_manager.current_best_block().into();
765766
let locked_node_metrics = self.node_metrics.read().expect("lock");
766767
let latest_lightning_wallet_sync_timestamp =
@@ -778,6 +779,7 @@ impl Node {
778779

779780
NodeStatus {
780781
is_running,
782+
network,
781783
current_best_block,
782784
latest_lightning_wallet_sync_timestamp,
783785
latest_onchain_wallet_sync_timestamp,
@@ -2079,6 +2081,8 @@ impl From<BlockLocator> for BestBlock {
20792081
pub struct NodeStatus {
20802082
/// Indicates whether the [`Node`] is running.
20812083
pub is_running: bool,
2084+
/// Network (e.g. mainnet, testnet4, signet) on which the [`Node`] is running.
2085+
pub network: Network,
20822086
/// The best block to which our Lightning wallet is currently synced.
20832087
pub current_best_block: BestBlock,
20842088
/// The timestamp, in seconds since start of the UNIX epoch, when we last successfully synced

0 commit comments

Comments
 (0)