From: Matt Corallo Date: Mon, 30 Sep 2024 18:03:12 +0000 (+0000) Subject: Allow `_` in `Hostname`s X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=829dc34d103ef921f2346fb7e9dc1aa8fb9212e9;p=rust-lightning Allow `_` in `Hostname`s These are perfectly fine and are relied on by BIP 353, so we need to ensure we allow them. --- diff --git a/lightning/src/util/ser.rs b/lightning/src/util/ser.rs index 21ce044e3..e27d49293 100644 --- a/lightning/src/util/ser.rs +++ b/lightning/src/util/ser.rs @@ -1496,8 +1496,7 @@ impl Hostname { s.len() <= 255 && s.chars().all(|c| c.is_ascii_alphanumeric() || - c == '.' || - c == '-' + c == '.' || c == '_' || c == '-' ) } }