network: don't announce genesis block (#3081)

This commit is contained in:
André Silva
2019-07-10 12:36:27 +01:00
committed by Bastian Köcher
parent ab761f7a09
commit 8f81bd90e7
+6
View File
@@ -1036,6 +1036,12 @@ impl<B: BlockT, S: NetworkSpecialization<B>, H: ExHashT> Protocol<B, S, H> {
return;
}
};
// don't announce genesis block since it will be ignored
if header.number().is_zero() {
return;
}
let hash = header.hash();
let message = GenericMessage::BlockAnnounce(message::BlockAnnounce { header: header.clone() });