fix: Simplify ChainVerifier
This commit is contained in:
parent
c95c825707
commit
132875198e
|
|
@ -118,7 +118,7 @@ where
|
||||||
// to use BlockVerifier, CheckpointVerifier, or both.
|
// to use BlockVerifier, CheckpointVerifier, or both.
|
||||||
|
|
||||||
// Call a verifier based on the block height and checkpoints.
|
// Call a verifier based on the block height and checkpoints.
|
||||||
let hash = match height {
|
match height {
|
||||||
Some(height) if (height <= max_checkpoint_height) => {
|
Some(height) if (height <= max_checkpoint_height) => {
|
||||||
checkpoint_verifier
|
checkpoint_verifier
|
||||||
.ready_and()
|
.ready_and()
|
||||||
|
|
@ -126,7 +126,7 @@ where
|
||||||
.call(block.clone())
|
.call(block.clone())
|
||||||
.await?
|
.await?
|
||||||
}
|
}
|
||||||
Some(height) => {
|
_ => {
|
||||||
// Temporary trace, for identifying early high blocks.
|
// Temporary trace, for identifying early high blocks.
|
||||||
// We think the downloader or sync service should reject these blocks
|
// We think the downloader or sync service should reject these blocks
|
||||||
if is_unexpected_high_block {
|
if is_unexpected_high_block {
|
||||||
|
|
@ -139,10 +139,6 @@ where
|
||||||
.call(block.clone())
|
.call(block.clone())
|
||||||
.await?
|
.await?
|
||||||
}
|
}
|
||||||
None => {
|
|
||||||
tracing::debug!("rejecting block with no coinbase height");
|
|
||||||
return Err("Invalid block: must have a coinbase height".into());
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO(teor):
|
// TODO(teor):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue