File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
core/src/consensus/tendermint Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -655,8 +655,13 @@ impl Worker {
655655 TwoThirdsMajority :: Lock ( _, block_hash) => Some ( * block_hash) ,
656656 } ;
657657 let block_hash = block_hash_candidate. filter ( |hash| {
658- let block =
659- self . client ( ) . block ( & BlockId :: Hash ( * hash) ) . expect ( "Already got imported block hash" ) ;
658+ let block = match self . client ( ) . block ( & BlockId :: Hash ( * hash) ) {
659+ Some ( block) => block,
660+ // When a node locks on a proposal and doesn't imported the proposal yet,
661+ // we could not check the proposal's generated time.
662+ // To make the network healthier in the corner case, we send a prevote message to the locked block.
663+ None => return true ,
664+ } ;
660665 self . is_generation_time_relevant ( & block. decode_header ( ) )
661666 } ) ;
662667 self . generate_and_broadcast_message ( block_hash, is_restoring) ;
You can’t perform that action at this time.
0 commit comments