Do not send messages twice in bitfield distribution (#2005)

* Do not send messages twice in bitfield distribution

This removes a bug which resulted in sending bitfield messages multiple
times by not checking if we already relayed them. Besides that it also
adds an optimization to not relay a message to a peer that send us
this message.

* Review comments

* Break some lines
This commit is contained in:
Bastian Köcher
2020-11-24 22:40:36 +01:00
committed by GitHub
parent 74efba2a21
commit 884b432035
4 changed files with 233 additions and 65 deletions
@@ -20,9 +20,7 @@ bitvec = { version = "0.17.4", default-features = false, features = ["alloc"] }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" }
maplit = "1.0.2"
log = "0.4.11"
env_logger = "0.8.2"
assert_matches = "1.4.0"
tempfile = "3.1.0"