Shell: stricter fitness check on block injection

This commit is contained in:
Grégoire Henry 2018-05-09 23:09:56 +02:00 committed by Benjamin Canou
parent ccad901f33
commit b1d70d576c

View File

@ -400,7 +400,7 @@ let validate_block w ?(force = false) hash block operations =
Chain.head nv.parameters.chain_state >>= fun head -> Chain.head nv.parameters.chain_state >>= fun head ->
let head = State.Block.header head in let head = State.Block.header head in
if if
force || Fitness.(head.shell.fitness <= block.shell.fitness) force || Fitness.(head.shell.fitness < block.shell.fitness)
then then
Block_validator.validate Block_validator.validate
~canceler:(Worker.canceler w) ~canceler:(Worker.canceler w)