From bebb9ff8de0f43c49fa90896a0ed63b651f49830 Mon Sep 17 00:00:00 2001 From: Hansie Odendaal Date: Fri, 23 Aug 2024 07:45:15 +0200 Subject: [PATCH] review comments --- base_layer/p2p/src/initialization.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/base_layer/p2p/src/initialization.rs b/base_layer/p2p/src/initialization.rs index afe0471dc9..dd8e51f15e 100644 --- a/base_layer/p2p/src/initialization.rs +++ b/base_layer/p2p/src/initialization.rs @@ -464,6 +464,11 @@ impl P2pInitializer { connector: PubsubDomainConnector, noise_prologue: Vec, ) -> Self { + const PREFIX: &[u8] = b"com.tari.comms.noise."; + let mut noise_prologue_buf = vec![0u8; PREFIX.len() + noise_prologue.len()]; + noise_prologue_buf[..PREFIX.len()].copy_from_slice(PREFIX); + noise_prologue_buf[PREFIX.len()..].copy_from_slice(&noise_prologue); + Self { config, user_agent, @@ -471,7 +476,7 @@ impl P2pInitializer { network, node_identity, connector: Some(connector), - noise_prologue, + noise_prologue: noise_prologue_buf, } }