mirror of
https://github.com/logos-blockchain/logos-blockchain-specs.git
synced 2026-01-26 17:03:05 +00:00
Safe block
This commit is contained in:
parent
d00eae4c2c
commit
a5b7c54ccd
@ -256,7 +256,10 @@ class Carnot:
|
||||
return self.genesis_block()
|
||||
|
||||
def block_is_safe(self, block: Block) -> bool:
|
||||
if isinstance(block.qc, (StandardQc,)):
|
||||
if isinstance(block.qc, StandardQc):
|
||||
return block.view_num == block.qc.view() + 1
|
||||
if isinstance(block.qc, (AggregateQc,)):
|
||||
return (block.view_num == block.qc.view() + 1) and block.extends(self.latest_committed_block())
|
||||
elif isinstance(block.qc, AggregateQc):
|
||||
return block.view_num == block.qc.view() + 1 and block.extends(self.latest_committed_block())
|
||||
else:
|
||||
return False
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user