mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-05 13:46:42 +00:00
Change PoW error (#1234)
* Use proper error for invalid PoW * Add comment
This commit is contained in:
parent
dc3ae4d3ac
commit
b510fc08a7
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user