mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-10 05:09:22 +00:00
Restore cache
This commit is contained in:
@@ -176,6 +176,16 @@ impl<T: TendermintValidator> TendermintImport<T> {
|
|||||||
&self,
|
&self,
|
||||||
block: &mut BlockImportParams<T::Block, BT>,
|
block: &mut BlockImportParams<T::Block, BT>,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
|
if block.finalized {
|
||||||
|
if block.fork_choice != Some(ForkChoiceStrategy::Custom(false)) {
|
||||||
|
// Since we alw1ays set the fork choice, this means something else marked the block as
|
||||||
|
// finalized, which shouldn't be possible. Ensuring nothing else is setting blocks as
|
||||||
|
// finalized helps ensure our security
|
||||||
|
panic!("block was finalized despite not setting the fork choice");
|
||||||
|
}
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
// Set the block as a worse choice
|
// Set the block as a worse choice
|
||||||
block.fork_choice = Some(ForkChoiceStrategy::Custom(false));
|
block.fork_choice = Some(ForkChoiceStrategy::Custom(false));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user