Ignore duplicate blocks in fork choice

This commit is contained in:
Paul Hauner
2020-01-19 22:08:35 +11:00
parent 10d37b26dc
commit c546cab03f

View File

@@ -130,6 +130,11 @@ impl ProtoArray {
justified_epoch: Epoch,
finalized_epoch: Epoch,
) -> Result<(), Error> {
// If the block is already known, simply ignore it.
if self.indices.contains_key(&root) {
return Ok(());
}
let node_index = self.nodes.len();
let node = ProtoNode {