Skip to content

Commit f01b427

Browse files
committed
chore: move another clone
1 parent 346bc93 commit f01b427

File tree

1 file changed

+9
-12
lines changed
  • stackslib/src/chainstate/nakamoto

1 file changed

+9
-12
lines changed

stackslib/src/chainstate/nakamoto/mod.rs

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4545,20 +4545,17 @@ impl NakamotoChainState {
45454545
Ok(lockup_events) => lockup_events,
45464546
};
45474547

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) {
45524550
// Receipts are appended in order, so the first receipt should be
45534551
// 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);
45594554
}
45604555
}
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() {
45624559
info!("Unable to attach lockup events, block's first transaction is not a coinbase transaction. Will attach as a phantom tx.");
45634560
}
45644561

@@ -4634,7 +4631,7 @@ impl NakamotoChainState {
46344631
applied_epoch_transition,
46354632
signer_set_calc.is_some(),
46364633
coinbase_height,
4637-
phantom_lockup_events,
4634+
lockup_events,
46384635
);
46394636
}
46404637

@@ -4752,7 +4749,7 @@ impl NakamotoChainState {
47524749
epoch_receipt,
47534750
clarity_commit,
47544751
reward_set_data,
4755-
phantom_lockup_events,
4752+
lockup_events,
47564753
))
47574754
}
47584755

0 commit comments

Comments
 (0)