Skip to content

Commit 792e1c1

Browse files
committed
refactor: Change args to extract_connecting_microblocks()
1 parent f4b89f8 commit 792e1c1

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

stackslib/src/chainstate/stacks/db/blocks.rs

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5997,29 +5997,26 @@ impl StacksChainState {
59975997
/// the given block.
59985998
pub fn extract_connecting_microblocks(
59995999
parent_block_header_info: &StacksHeaderInfo,
6000-
next_staging_block: &StagingBlock,
6000+
next_block_consensus_hash: &ConsensusHash,
6001+
next_block_hash: &BlockHeaderHash,
60016002
block: &StacksBlock,
60026003
mut next_microblocks: Vec<StacksMicroblock>,
60036004
) -> Result<Vec<StacksMicroblock>, Error> {
60046005
// NOTE: since we got the microblocks from staging, where their signatures were already
60056006
// validated, we don't need to validate them again.
6006-
let microblock_terminus = match StacksChainState::validate_parent_microblock_stream(
6007+
let Some((microblock_terminus, _)) = StacksChainState::validate_parent_microblock_stream(
60076008
parent_block_header_info
60086009
.anchored_header
60096010
.as_stacks_epoch2()
60106011
.ok_or_else(|| Error::InvalidChildOfNakomotoBlock)?,
60116012
&block.header,
60126013
&next_microblocks,
60136014
false,
6014-
) {
6015-
Some((terminus, _)) => terminus,
6016-
None => {
6017-
debug!(
6018-
"Stopping at block {}/{} -- discontiguous header stream",
6019-
next_staging_block.consensus_hash, next_staging_block.anchored_block_hash,
6020-
);
6021-
return Ok(vec![]);
6022-
}
6015+
) else {
6016+
debug!(
6017+
"Stopping at block {next_block_consensus_hash}/{next_block_hash} -- discontiguous header stream"
6018+
);
6019+
return Ok(vec![]);
60236020
};
60246021

60256022
// do not consider trailing microblocks that this anchored block does _not_ confirm
@@ -6214,7 +6211,8 @@ impl StacksChainState {
62146211
// block's parent to this block.
62156212
let next_microblocks = StacksChainState::extract_connecting_microblocks(
62166213
&parent_header_info,
6217-
&next_staging_block,
6214+
&parent_header_info.consensus_hash,
6215+
&next_staging_block.anchored_block_hash,
62186216
&block,
62196217
next_microblocks,
62206218
)?;

stackslib/src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1701,7 +1701,8 @@ fn replay_block(stacks_path: &str, index_block_hash_hex: &str) {
17011701
// block's parent to this block.
17021702
let next_microblocks = StacksChainState::extract_connecting_microblocks(
17031703
&parent_header_info,
1704-
&next_staging_block,
1704+
&next_staging_block.consensus_hash,
1705+
&next_staging_block.anchored_block_hash,
17051706
&block,
17061707
next_microblocks,
17071708
)

0 commit comments

Comments
 (0)