File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
core/src/consensus/tendermint Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ use crate::encoded;
5252use crate :: error:: { BlockError , Error } ;
5353use crate :: snapshot_notify:: NotifySender as SnapshotNotifySender ;
5454use crate :: transaction:: { SignedTransaction , UnverifiedTransaction } ;
55+ use crate :: types:: BlockStatus ;
5556use crate :: views:: BlockView ;
5657use crate :: BlockId ;
5758use std:: cell:: Cell ;
@@ -958,7 +959,7 @@ impl Worker {
958959 }
959960
960961 pub fn on_imported_proposal ( & mut self , proposal : & Header ) {
961- if proposal. number ( ) < 1 {
962+ if self . client ( ) . block_status ( & BlockId :: Hash ( * proposal. parent_hash ( ) ) ) == BlockStatus :: Unknown {
962963 return
963964 }
964965
@@ -1660,11 +1661,10 @@ impl Worker {
16601661 let mut last_term_end = None ;
16611662 for block_hash in & enacted {
16621663 let header = c. block_header ( & BlockId :: Hash ( * block_hash) ) . expect ( "Block is enacted" ) . decode ( ) ;
1663- if header. number ( ) == 0 {
1664- continue
1665- }
1666- let parent_header =
1667- c. block_header ( & BlockId :: Hash ( * header. parent_hash ( ) ) ) . expect ( "Parent block should be enacted" ) . decode ( ) ;
1664+ let parent_header = match c. block_header ( & BlockId :: Hash ( * header. parent_hash ( ) ) ) {
1665+ Some ( h) => h. decode ( ) ,
1666+ None => continue ,
1667+ } ;
16681668 let term_common_params = if let Some ( p) = c. term_common_params ( parent_header. hash ( ) . into ( ) ) {
16691669 p
16701670 } else {
You can’t perform that action at this time.
0 commit comments