diff --git a/domain/consensus/processes/blockvalidator/proof_of_work.go b/domain/consensus/processes/blockvalidator/proof_of_work.go index b83076c79..ffb38ba8a 100644 --- a/domain/consensus/processes/blockvalidator/proof_of_work.go +++ b/domain/consensus/processes/blockvalidator/proof_of_work.go @@ -97,7 +97,7 @@ func (v *blockValidator) checkProofOfWork(header *externalapi.DomainBlockHeader) if !v.skipPoW { valid := pow.CheckProofOfWorkWithTarget(header, target) if !valid { - return errors.Wrap(ruleerrors.ErrUnexpectedDifficulty, "block has invalid difficulty") + return errors.Wrap(ruleerrors.ErrInvalidPoW, "block has invalid proof of work") } } return nil diff --git a/domain/consensus/ruleerrors/rule_error.go b/domain/consensus/ruleerrors/rule_error.go index 6d6c0fe97..4cd5e99d5 100644 --- a/domain/consensus/ruleerrors/rule_error.go +++ b/domain/consensus/ruleerrors/rule_error.go @@ -44,6 +44,9 @@ var ( // range. ErrUnexpectedDifficulty = newRuleError("ErrUnexpectedDifficulty") + // ErrInvalidPoW indicates that the block proof-of-work is invalid. + ErrInvalidPoW = newRuleError("ErrInvalidPoW") + // ErrHighHash indicates the block does not hash to a value which is // lower than the required target difficultly. ErrHighHash = newRuleError("ErrHighHash") @@ -56,7 +59,7 @@ var ( // the expected value. ErrBadUTXOCommitment = newRuleError("ErrBadUTXOCommitment") - // ErrInvalidSubnetwork indicates the subnetwork is now allowed. + // ErrInvalidSubnetwork indicates the subnetwork is not allowed. ErrInvalidSubnetwork = newRuleError("ErrInvalidSubnetwork") // ErrFinalityPointTimeTooOld indicates a block has a timestamp before the