Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 162
Allow disabling wallet background syncing#508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
tnull
merged 1 commit into
lightningdevkit:main
from
alexanderwiederin:optional-wallet-syncMar 28, 2025
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -282,7 +282,7 @@ pub(crate) fn default_user_config(config: &Config) -> UserConfig { | ||
| user_config | ||
| } | ||
| /// Options related to syncing the Lightning and on-chain wallets via an Esplora backend. | ||
| /// Options related to background syncing the Lightning and on-chain wallets. | ||
| /// | ||
| /// ### Defaults | ||
| /// | ||
| @@ -292,22 +292,24 @@ pub(crate) fn default_user_config(config: &Config) -> UserConfig { | ||
| /// | `lightning_wallet_sync_interval_secs` | 30 | | ||
| /// | `fee_rate_cache_update_interval_secs` | 600 | | ||
| #[derive(Debug, Copy, Clone, PartialEq, Eq)] | ||
| pub struct EsploraSyncConfig { | ||
| pub struct BackgroundSyncConfig { | ||
| /// The time in-between background sync attempts of the onchain wallet, in seconds. | ||
| /// | ||
| /// **Note:** A minimum of 10 seconds is always enforced. | ||
| /// **Note:** A minimum of 10 seconds is enforced when background syncing is enabled. | ||
| pub onchain_wallet_sync_interval_secs: u64, | ||
| /// The time in-between background sync attempts of the LDK wallet, in seconds. | ||
| /// | ||
| /// **Note:** A minimum of 10 seconds is always enforced. | ||
| /// **Note:** A minimum of 10 seconds is enforced when background syncing is enabled. | ||
| pub lightning_wallet_sync_interval_secs: u64, | ||
| /// The time in-between background update attempts to our fee rate cache, in seconds. | ||
| /// | ||
| /// **Note:** A minimum of 10 seconds is always enforced. | ||
| /// **Note:** A minimum of 10 seconds is enforced when background syncing is enabled. | ||
| pub fee_rate_cache_update_interval_secs: u64, | ||
| } | ||
| impl Default for EsploraSyncConfig { | ||
| impl Default for BackgroundSyncConfig { | ||
| fn default() -> Self { | ||
| Self { | ||
| onchain_wallet_sync_interval_secs: DEFAULT_BDK_WALLET_SYNC_INTERVAL_SECS, | ||
| @@ -317,6 +319,27 @@ impl Default for EsploraSyncConfig { | ||
| } | ||
| } | ||
| /// Configuration for syncing with an Esplora backend. | ||
| /// | ||
| /// Background syncing is enabled by default, using the default values specified in | ||
| /// [`BackgroundSyncConfig`]. | ||
| #[derive(Debug, Copy, Clone, PartialEq, Eq)] | ||
| pub struct EsploraSyncConfig { | ||
| /// Background sync configuration. | ||
| /// | ||
| /// If set to `None`, background syncing will be disabled. Users will need to manually | ||
| /// sync via `Node::sync_wallets` for the wallets and fee rate updates. | ||
| /// | ||
| /// [`Node::sync_wallets`]: crate::Node::sync_wallets | ||
| pub background_sync_config: Option<BackgroundSyncConfig>, | ||
| } | ||
| impl Default for EsploraSyncConfig { | ||
alexanderwiederin marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| fn default() -> Self { | ||
| Self { background_sync_config: Some(BackgroundSyncConfig::default()) } | ||
| } | ||
| } | ||
| /// Options which apply on a per-channel basis and may change at runtime or based on negotiation | ||
| /// with our counterparty. | ||
| #[derive(Copy, Clone, Debug, PartialEq, Eq)] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.