From 7611c08679f6c85f95663deac0c0f84dc23cee05 Mon Sep 17 00:00:00 2001 From: Toralf Wittner Date: Tue, 24 Sep 2019 13:53:16 +0200 Subject: [PATCH] Fix invalid debug assertion. (#3663) The current `debug_assert_eq` is clearly wrong as the code handles zero response blocks. What should have been expressed is that we expect 0 or 1 response blocks. --- substrate/core/network/src/protocol/sync.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/substrate/core/network/src/protocol/sync.rs b/substrate/core/network/src/protocol/sync.rs index cf7d899d6d..59ad48b225 100644 --- a/substrate/core/network/src/protocol/sync.rs +++ b/substrate/core/network/src/protocol/sync.rs @@ -667,7 +667,7 @@ impl ChainSync { peer.state = PeerSyncState::Available; // We only request one justification at a time - debug_assert_eq!(1, response.blocks.len()); + debug_assert!(response.blocks.len() < 2); if let Some(block) = response.blocks.into_iter().next() { if hash != block.hash {