Skip to content

Commit 5e156de

Browse files
committed
f - address review comments
1 parent b1df685 commit 5e156de

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lightning/src/routing/gossip.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,7 @@ impl_writeable_tlv_based!(NodeAnnouncementInfo, {
929929
///
930930
/// [security considerations]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#security-considerations-for-node-aliases
931931
#[derive(Clone, Debug, PartialEq)]
932-
pub struct NodeAlias([u8; 32]);
932+
pub struct NodeAlias(pub [u8; 32]);
933933

934934
impl fmt::Display for NodeAlias {
935935
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
@@ -944,7 +944,7 @@ impl fmt::Display for NodeAlias {
944944
},
945945
Err(_) => {
946946
bytes.iter().map(|b| *b as char)
947-
.map(|c| if c.is_ascii_graphic() || c == ' ' { c } else { control_symbol })
947+
.map(|c| if c >= '\x20' && c <= '\x7e' { c } else { control_symbol })
948948
.collect::<String>()
949949
},
950950
};

0 commit comments

Comments
 (0)