Skip to content

Commit

Permalink
fix: incorrect and inadequate checks of sync message
Browse files Browse the repository at this point in the history
  • Loading branch information
yangby-cryptape committed Oct 13, 2023
1 parent 5dadcbf commit 47a3460
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sync/src/synchronizer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 47a3460

Please sign in to comment.