Skip to content

Do not error on startup for optional values#124

Merged
benthecarman merged 1 commit intolightningdevkit:mainfrom
elnosh:optional-confs
Feb 15, 2026
Merged

Do not error on startup for optional values#124
benthecarman merged 1 commit intolightningdevkit:mainfrom
elnosh:optional-confs

Conversation

@elnosh
Copy link
Contributor

@elnosh elnosh commented Feb 14, 2026

If the config file didn't have listening_addresses, announcement_addresses or dir_path it would err and fail to start up.

  • For dir_path it would fail before it could fallback to the ~/.ldk-server/ default.
  • For listening_addresses and announcement_addresses I think those should be options as well (?) so removed those errors

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Feb 14, 2026

🎉 This PR is now ready for review!
Please choose at least one reviewer by assigning them on the right bar.
If no reviewers are assigned within 10 minutes, I'll automatically assign one.
Once the first reviewer has submitted a review, a second will be assigned if required.

@benthecarman
Copy link
Collaborator

can you add tests for this?

@elnosh elnosh marked this pull request as draft February 14, 2026 18:58
@elnosh elnosh force-pushed the optional-confs branch 2 times, most recently from 8af3e9b to 874e098 Compare February 14, 2026 20:16
@elnosh elnosh marked this pull request as ready for review February 14, 2026 20:16
Some(storage_path.join(config_file_name).to_string_lossy().to_string());

// Test with optional values not specified in the config file
#[cfg(not(any()))]
Copy link
Collaborator

Choose a reason for hiding this comment

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

why this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

woops, residue from my debugging this test. Removed.

Do not error on startup if storage path,
listening addresses or announcement
addresses fields were not specified
in the config as these are optional
values.
@benthecarman benthecarman merged commit 2c3dd1c into lightningdevkit:main Feb 15, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants