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 @@ -657,8 +657,13 @@ impl Worker {
657657 TwoThirdsMajority :: Lock ( _, block_hash) => Some ( * block_hash) ,
658658 } ;
659659 let block_hash = block_hash_candidate. filter ( |hash| {
660- let block =
661- self . client ( ) . block ( & BlockId :: Hash ( * hash) ) . expect ( "Already got imported block hash" ) ;
660+ let block = match self . client ( ) . block ( & BlockId :: Hash ( * hash) ) {
661+ Some ( block) => block,
662+ // When a node locks on a proposal and doesn't imported the proposal yet,
663+ // we could not check the proposal's generated time.
664+ // To make the network healthier in the corner case, we send a prevote message to the locked block.
665+ None => return true ,
666+ } ;
662667 self . is_generation_time_relevant ( & block. decode_header ( ) )
663668 } ) ;
664669 self . generate_and_broadcast_message ( block_hash, is_restoring) ;
You can’t perform that action at this time.
0 commit comments