Skip to content

Commit a63b1e5

Browse files
authored
Merge pull request #5396 from stacks-network/fix/check-block-state-in-validate-reject
Fix/check block state check in validate reject
2 parents 452fbaf + 3d67fcb commit a63b1e5

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

stacks-signer/src/v0/signer.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -526,9 +526,8 @@ impl Signer {
526526
{
527527
debug!("{self}: Received block validation for a block that is already marked as {}. Ignoring...", block_info.state);
528528
return None;
529-
} else {
530-
block_info
531529
}
530+
block_info
532531
}
533532
Ok(None) => {
534533
// We have not seen this block before. Why are we getting a response for it?
@@ -569,7 +568,15 @@ impl Signer {
569568
.signer_db
570569
.block_lookup(self.reward_cycle, &signer_signature_hash)
571570
{
572-
Ok(Some(block_info)) => block_info,
571+
Ok(Some(block_info)) => {
572+
if block_info.state == BlockState::GloballyRejected
573+
|| block_info.state == BlockState::GloballyAccepted
574+
{
575+
debug!("{self}: Received block validation for a block that is already marked as {}. Ignoring...", block_info.state);
576+
return None;
577+
}
578+
block_info
579+
}
573580
Ok(None) => {
574581
// We have not seen this block before. Why are we getting a response for it?
575582
debug!("{self}: Received a block validate response for a block we have not seen before. Ignoring...");

0 commit comments

Comments
 (0)