Skip to content

Commit e771bff

Browse files
andresilvadarkfriend77
authored andcommitted
network: don't force send block announcements (paritytech#7601)
1 parent 39b3132 commit e771bff

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

client/network/src/protocol.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,16 +1083,11 @@ impl<B: BlockT, H: ExHashT> Protocol<B, H> {
10831083

10841084
let is_best = self.context_data.chain.info().best_hash == hash;
10851085
debug!(target: "sync", "Reannouncing block {:?} is_best: {}", hash, is_best);
1086-
self.send_announcement(&header, data, is_best, true)
1087-
}
1088-
1089-
fn send_announcement(&mut self, header: &B::Header, data: Vec<u8>, is_best: bool, force: bool) {
1090-
let hash = header.hash();
10911086

10921087
for (who, ref mut peer) in self.context_data.peers.iter_mut() {
1093-
trace!(target: "sync", "Announcing block {:?} to {}", hash, who);
10941088
let inserted = peer.known_blocks.insert(hash);
1095-
if inserted || force {
1089+
if inserted {
1090+
trace!(target: "sync", "Announcing block {:?} to {}", hash, who);
10961091
let message = message::BlockAnnounce {
10971092
header: header.clone(),
10981093
state: if is_best {

0 commit comments

Comments
 (0)