Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions ldk-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,11 @@ fn main() {
},
}

info!(
"CONNECTION_STRING: {}@{}",
node.node_id(),
node.config().listening_addresses.as_ref().unwrap().first().unwrap()
);
if let Some(addresses) = node.config().listening_addresses {
if !addresses.is_empty() {
info!("CONNECTION_STRING: {}@{}", node.node_id(), addresses.first().unwrap());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this still be Some(vec![])? Would be safer to also not unwrap first()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried setting it empty/blank in the config i.e listening_addresses = [] and it would error out before this with invalid address. I can remove that unwrap as well though, I guess it wouldn't hurt.

}
}

runtime.block_on(async {
// Register SIGHUP handler for log rotation
Expand Down