Skip to content

Commit f52ab1f

Browse files
committed
fix: return type of new_burn_block_fork_descendency_check
The return type was `Result<bool>`, but it only needed to be `bool`
1 parent cb149b0 commit f52ab1f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

stacks-signer/src/v0/signer_state.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,7 @@ impl LocalStateMachine {
10531053
expected_burn_block,
10541054
prior_state_machine.burn_block_height,
10551055
prior_state_machine.burn_block,
1056-
)? {
1056+
) {
10571057
info!("Detected bitcoin fork - prior tip is not parent of new tip.";
10581058
"new_tip.burn_block_height" => expected_burn_block.burn_block_height,
10591059
"new_tip.consensus_hash" => %expected_burn_block.consensus_hash,
@@ -1317,14 +1317,14 @@ impl LocalStateMachine {
13171317
new_burn_block: &NewBurnBlock,
13181318
prior_burn_block_height: u64,
13191319
prior_burn_block_ch: ConsensusHash,
1320-
) -> Result<bool, SignerChainstateError> {
1320+
) -> bool {
13211321
let max_height_delta = 10;
13221322
let height_delta = match new_burn_block
13231323
.burn_block_height
13241324
.checked_sub(prior_burn_block_height)
13251325
{
1326-
None | Some(0) => return Ok(false), // same height or older
1327-
Some(d) if d > max_height_delta => return Ok(false), // too far apart
1326+
None | Some(0) => return false, // same height or older
1327+
Some(d) if d > max_height_delta => return false, // too far apart
13281328
Some(d) => d,
13291329
};
13301330

@@ -1340,13 +1340,13 @@ impl LocalStateMachine {
13401340
new_burn_block.consensus_hash;
13411341
"error" => ?e,
13421342
);
1343-
return Ok(false);
1343+
return false;
13441344
}
13451345
};
13461346

13471347
for _ in 0..height_delta {
13481348
if parent_burn_block_info.block_height == prior_burn_block_height {
1349-
return Ok(parent_burn_block_info.consensus_hash != prior_burn_block_ch);
1349+
return parent_burn_block_info.consensus_hash != prior_burn_block_ch;
13501350
}
13511351

13521352
parent_burn_block_info =
@@ -1357,11 +1357,11 @@ impl LocalStateMachine {
13571357
"Failed to get parent burn block info for {}. Error: {e}",
13581358
parent_burn_block_info.parent_burn_block_hash
13591359
);
1360-
return Ok(false);
1360+
return false;
13611361
}
13621362
};
13631363
}
13641364

1365-
Ok(false)
1365+
false
13661366
}
13671367
}

0 commit comments

Comments
 (0)