Skip to content

Commit

Permalink
feat(getinfo) : adds lampodir
Browse files Browse the repository at this point in the history
  • Loading branch information
Harshit933 authored and vincenzopalazzo committed Apr 11, 2024
1 parent f6ed209 commit e58553a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lampo-common/src/model/getinfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ pub struct GetInfo {
pub chain: String,
pub alias: String,
pub blockheight: u32,
pub lampo_dir: String,
}
2 changes: 2 additions & 0 deletions lampod/src/ln/inventory_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ impl InventoryHandler for LampoInventoryManager {
let alias = alias.unwrap_or_default();
let (_, height) = self.channel_manager.onchain.backend.get_best_block()?;
let blockheight = height.unwrap_or_default();
let lampo_dir = self.channel_manager.conf.root_path.to_string();
let getinfo = GetInfo {
node_id: self.channel_manager.manager().get_our_node_id().to_string(),
peers: self.peer_manager.manager().list_peers().len(),
channels: self.channel_manager.manager().list_channels().len(),
chain,
alias,
blockheight,
lampo_dir,
};
let getinfo = json::to_value(getinfo)?;
chan.send(getinfo)?;
Expand Down

0 comments on commit e58553a

Please sign in to comment.