From 47a34607b4a89e81b80b2237f1aef7e8f23c3c42 Mon Sep 17 00:00:00 2001 From: Boyu Yang Date: Fri, 13 Oct 2023 14:28:33 +0800 Subject: [PATCH] fix: incorrect and inadequate checks of sync message --- sync/src/synchronizer/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sync/src/synchronizer/mod.rs b/sync/src/synchronizer/mod.rs index 1ad1dfccffb..3808a8ca1fa 100644 --- a/sync/src/synchronizer/mod.rs +++ b/sync/src/synchronizer/mod.rs @@ -716,7 +716,7 @@ impl CKBProtocolHandler for Synchronizer { Ok(msg) => { let item = msg.to_enum(); if let packed::SyncMessageUnionReader::SendBlock(ref reader) = item { - if reader.count_extra_fields() > 1 { + if reader.has_extra_fields() || reader.block.count_extra_fields() > 1 { info!( "Peer {} sends us a malformed message: \ too many fields in SendBlock",