|
1 | 1 | use crate::config::{ |
2 | | - Config, BDK_CLIENT_CONCURRENCY, BDK_CLIENT_STOP_GAP, DEFAULT_ESPLORA_SERVER_URL, |
3 | | - WALLET_KEYS_SEED_LEN, |
| 2 | + default_user_config, Config, BDK_CLIENT_CONCURRENCY, BDK_CLIENT_STOP_GAP, |
| 3 | + DEFAULT_ESPLORA_SERVER_URL, WALLET_KEYS_SEED_LEN, |
4 | 4 | }; |
5 | 5 | use crate::connection::ConnectionManager; |
6 | 6 | use crate::event::EventQueue; |
@@ -31,7 +31,6 @@ use lightning::routing::scoring::{ |
31 | 31 | }; |
32 | 32 | use lightning::sign::EntropySource; |
33 | 33 |
|
34 | | -use lightning::util::config::UserConfig; |
35 | 34 | use lightning::util::persist::{ |
36 | 35 | read_channel_monitors, CHANNEL_MANAGER_PERSISTENCE_KEY, |
37 | 36 | CHANNEL_MANAGER_PERSISTENCE_PRIMARY_NAMESPACE, CHANNEL_MANAGER_PERSISTENCE_SECONDARY_NAMESPACE, |
@@ -686,19 +685,7 @@ fn build_with_store_internal( |
686 | 685 | }, |
687 | 686 | }; |
688 | 687 |
|
689 | | - // Initialize the default config values. |
690 | | - // |
691 | | - // Note that methods such as Node::connect_open_channel might override some of the values set |
692 | | - // here, e.g. the ChannelHandshakeConfig, meaning these default values will mostly be relevant |
693 | | - // for inbound channels. |
694 | | - let mut user_config = UserConfig::default(); |
695 | | - user_config.channel_handshake_limits.force_announced_channel_preference = false; |
696 | | - user_config.manually_accept_inbound_channels = true; |
697 | | - // Note the channel_handshake_config will be overwritten in `connect_open_channel`, but we |
698 | | - // still set a default here. |
699 | | - user_config.channel_handshake_config.negotiate_anchors_zero_fee_htlc_tx = |
700 | | - config.anchor_channels_config.is_some(); |
701 | | - |
| 688 | + let mut user_config = default_user_config(&config); |
702 | 689 | if liquidity_source_config.and_then(|lsc| lsc.lsps2_service.as_ref()).is_some() { |
703 | 690 | // Generally allow claiming underpaying HTLCs as the LSP will skim off some fee. We'll |
704 | 691 | // check that they don't take too much before claiming. |
|
0 commit comments