File tree Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,11 @@ dictionary Config {
13
13
u64 probing_liquidity_limit_multiplier;
14
14
AnchorChannelsConfig? anchor_channels_config;
15
15
SendingParameters? sending_parameters;
16
+ HumanReadableNamesConfig? hrn_config;
17
+ };
18
+
19
+ dictionary HumanReadableNamesConfig {
20
+ sequence<PublicKey> dns_resolvers_node_ids;
16
21
};
17
22
18
23
dictionary AnchorChannelsConfig {
@@ -312,6 +317,7 @@ enum NodeError {
312
317
"LiquiditySourceUnavailable",
313
318
"LiquidityFeeTooHigh",
314
319
"HrnParsingFailed",
320
+ "DnsResolversUnavailable",
315
321
};
316
322
317
323
dictionary NodeStatus {
@@ -347,6 +353,7 @@ enum BuildError {
347
353
"WalletSetupFailed",
348
354
"LoggerSetupFailed",
349
355
"NetworkMismatch",
356
+ "DnsResolversUnavailable",
350
357
};
351
358
352
359
[Trait]
Original file line number Diff line number Diff line change @@ -174,6 +174,10 @@ pub enum BuildError {
174
174
LoggerSetupFailed ,
175
175
/// The given network does not match the node's previously configured network.
176
176
NetworkMismatch ,
177
+ /// The [`dns_resolvers_node_ids`] provided for HRN resolution is empty.
178
+ ///
179
+ /// [`dns_resolvers_node_ids`]: crate::config::HumanReadableNamesConfig::dns_resolvers_node_ids
180
+ DnsResolversUnavailable ,
177
181
}
178
182
179
183
impl fmt:: Display for BuildError {
@@ -201,6 +205,9 @@ impl fmt::Display for BuildError {
201
205
Self :: NetworkMismatch => {
202
206
write ! ( f, "Given network does not match the node's previously configured network." )
203
207
} ,
208
+ Self :: DnsResolversUnavailable => {
209
+ write ! ( f, "The DNS resolvers provided for HRN resolution is empty." )
210
+ } ,
204
211
}
205
212
}
206
213
}
@@ -1492,6 +1499,12 @@ fn build_with_store_internal(
1492
1499
} ,
1493
1500
} ;
1494
1501
1502
+ if let Some ( hrn_config) = & config. hrn_config {
1503
+ if hrn_config. dns_resolvers_node_ids . is_empty ( ) {
1504
+ return Err ( BuildError :: DnsResolversUnavailable ) ;
1505
+ }
1506
+ } ;
1507
+
1495
1508
let ( stop_sender, _) = tokio:: sync:: watch:: channel ( ( ) ) ;
1496
1509
let ( event_handling_stopped_sender, _) = tokio:: sync:: watch:: channel ( ( ) ) ;
1497
1510
Original file line number Diff line number Diff line change @@ -103,6 +103,7 @@ pub const WALLET_KEYS_SEED_LEN: usize = 64;
103
103
/// | `log_level` | Debug |
104
104
/// | `anchor_channels_config` | Some(..) |
105
105
/// | `sending_parameters` | None |
106
+ /// | `hrn_config` | None |
106
107
///
107
108
/// See [`AnchorChannelsConfig`] and [`SendingParameters`] for more information regarding their
108
109
/// respective default values.
@@ -167,6 +168,10 @@ pub struct Config {
167
168
/// **Note:** If unset, default parameters will be used, and you will be able to override the
168
169
/// parameters on a per-payment basis in the corresponding method calls.
169
170
pub sending_parameters : Option < SendingParameters > ,
171
+ /// Configuration options for Human-Readable Names ([BIP 353]).
172
+ ///
173
+ /// [BIP 353]: https://github.com/bitcoin/bips/blob/master/bip-0353.mediawiki
174
+ pub hrn_config : Option < HumanReadableNamesConfig > ,
170
175
}
171
176
172
177
impl Default for Config {
@@ -181,6 +186,7 @@ impl Default for Config {
181
186
anchor_channels_config : Some ( AnchorChannelsConfig :: default ( ) ) ,
182
187
sending_parameters : None ,
183
188
node_alias : None ,
189
+ hrn_config : None ,
184
190
}
185
191
}
186
192
}
You can’t perform that action at this time.
0 commit comments