@@ -4545,20 +4545,17 @@ impl NakamotoChainState {
4545
4545
Ok ( lockup_events) => lockup_events,
4546
4546
} ;
4547
4547
4548
- // Track events that we couldn't attach to a coinbase receipt
4549
- let mut phantom_lockup_events = lockup_events. clone ( ) ;
4550
- // if any, append lockups events to the coinbase receipt
4551
- if lockup_events. len ( ) > 0 {
4548
+ // If any, append lockups events to the coinbase receipt
4549
+ if let Some ( receipt) = tx_receipts. get_mut ( 0 ) {
4552
4550
// Receipts are appended in order, so the first receipt should be
4553
4551
// the one of the coinbase transaction
4554
- if let Some ( receipt) = tx_receipts. get_mut ( 0 ) {
4555
- if receipt. is_coinbase_tx ( ) {
4556
- receipt. events . append ( & mut lockup_events) ;
4557
- phantom_lockup_events. clear ( ) ;
4558
- }
4552
+ if receipt. is_coinbase_tx ( ) {
4553
+ receipt. events . append ( & mut lockup_events) ;
4559
4554
}
4560
4555
}
4561
- if phantom_lockup_events. len ( ) > 0 {
4556
+
4557
+ // If lockup_events still contains items, it means they weren't attached
4558
+ if !lockup_events. is_empty ( ) {
4562
4559
info ! ( "Unable to attach lockup events, block's first transaction is not a coinbase transaction. Will attach as a phantom tx." ) ;
4563
4560
}
4564
4561
@@ -4634,7 +4631,7 @@ impl NakamotoChainState {
4634
4631
applied_epoch_transition,
4635
4632
signer_set_calc. is_some ( ) ,
4636
4633
coinbase_height,
4637
- phantom_lockup_events ,
4634
+ lockup_events ,
4638
4635
) ;
4639
4636
}
4640
4637
@@ -4752,7 +4749,7 @@ impl NakamotoChainState {
4752
4749
epoch_receipt,
4753
4750
clarity_commit,
4754
4751
reward_set_data,
4755
- phantom_lockup_events ,
4752
+ lockup_events ,
4756
4753
) )
4757
4754
}
4758
4755
0 commit comments