@@ -439,16 +439,9 @@ pub fn command_try_mine(argv: &[String], conf: Option<&Config>) {
439
439
)
440
440
. unwrap_or_else ( |e| panic ! ( "Failed to open mempool db: {e}" ) ) ;
441
441
442
- let header_tip = NakamotoChainState :: get_canonical_block_header ( chain_state. db ( ) , & sort_db)
443
- . unwrap ( )
444
- . unwrap ( ) ;
445
- let parent_header = StacksChainState :: get_anchored_block_header_info (
446
- chain_state. db ( ) ,
447
- & header_tip. consensus_hash ,
448
- & header_tip. anchored_header . block_hash ( ) ,
449
- )
450
- . unwrap_or_else ( |e| panic ! ( "Failed to load chain tip header info: {e}" ) )
451
- . expect ( "Failed to load chain tip header info" ) ;
442
+ let tip_header = NakamotoChainState :: get_canonical_block_header ( chain_state. db ( ) , & sort_db)
443
+ . unwrap_or_else ( |e| panic ! ( "Error looking up chain tip: {e}" ) )
444
+ . expect ( "No chain tip found" ) ;
452
445
453
446
let sk = StacksPrivateKey :: new ( ) ;
454
447
let mut tx_auth = TransactionAuth :: from_p2pkh ( & sk) . unwrap ( ) ;
@@ -473,7 +466,7 @@ pub fn command_try_mine(argv: &[String], conf: Option<&Config>) {
473
466
& chain_state,
474
467
& sort_db. index_handle ( & chain_tip. sortition_id ) ,
475
468
& mut mempool_db,
476
- & parent_header ,
469
+ & tip_header ,
477
470
chain_tip. total_burn ,
478
471
VRFProof :: empty ( ) ,
479
472
Hash160 ( [ 0 ; 20 ] ) ,
@@ -497,13 +490,13 @@ pub fn command_try_mine(argv: &[String], conf: Option<&Config>) {
497
490
} else {
498
491
"Failed to"
499
492
} ,
500
- parent_header . stacks_block_height + 1 ,
493
+ tip_header . stacks_block_height + 1 ,
501
494
StacksBlockHeader :: make_index_block_hash(
502
- & parent_header . consensus_hash,
503
- & parent_header . anchored_header. block_hash( )
495
+ & tip_header . consensus_hash,
496
+ & tip_header . anchored_header. block_hash( )
504
497
) ,
505
- & parent_header . consensus_hash,
506
- & parent_header . anchored_header. block_hash( ) ,
498
+ & tip_header . consensus_hash,
499
+ & tip_header . anchored_header. block_hash( ) ,
507
500
stop. saturating_sub( start) ,
508
501
min_fee,
509
502
max_time
0 commit comments