pub enum ValidateHeaderError {
HeaderIsOld,
DoesNotMatchCheckpoint,
InvalidPoWForHeaderTarget,
InvalidPoWForComputedTarget,
TargetDifficultyAboveMax,
HeightTooLow,
PrevHeaderNotFound,
}Expand description
An error thrown when trying to validate a header.
Variants§
HeaderIsOld
Used when the timestamp in the header is lower than the median of timestamps of past 11 headers.
DoesNotMatchCheckpoint
Used when the header doesn’t match with a checkpoint.
InvalidPoWForHeaderTarget
Used when the PoW in the header is invalid as per the target mentioned in the header.
InvalidPoWForComputedTarget
Used when the PoW in the header is invalid as per the target computed based on the previous headers.
TargetDifficultyAboveMax
Used when the target in the header is greater than the max possible value.
HeightTooLow
The next height is less than the tip height - 52_596 (one year worth of blocks).
PrevHeaderNotFound
Used when the predecessor of the input header is not found in the HeaderStore.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ValidateHeaderError
impl RefUnwindSafe for ValidateHeaderError
impl Send for ValidateHeaderError
impl Sync for ValidateHeaderError
impl Unpin for ValidateHeaderError
impl UnwindSafe for ValidateHeaderError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more