From 60d56f87ae800cf86be9e2ccd1c974da93de37f4 Mon Sep 17 00:00:00 2001 From: Jimmy Date: Fri, 24 Jan 2025 15:46:59 +0800 Subject: [PATCH] [Core P2P] fix the bug (#3695) * fix the bug * Update RemoteNode.cs Co-authored-by: Christopher Schuchardt --------- Co-authored-by: Christopher Schuchardt --- src/Neo/Network/P2P/RemoteNode.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Neo/Network/P2P/RemoteNode.cs b/src/Neo/Network/P2P/RemoteNode.cs index 11480c82af..f9e987dc5a 100644 --- a/src/Neo/Network/P2P/RemoteNode.cs +++ b/src/Neo/Network/P2P/RemoteNode.cs @@ -234,7 +234,9 @@ internal static Props Props(NeoSystem system, LocalNode localNode, object connec private void SendMessage(Message message) { ack = false; - SendData(ByteString.FromBytes(message.ToArray(Version.AllowCompression))); + // Here it is possible that we dont have the Version message yet, + // so we need to send the message uncompressed + SendData(ByteString.FromBytes(message.ToArray(Version?.AllowCompression ?? false))); sentCommands[(byte)message.Command] = true; }