aboutsummaryrefslogtreecommitdiffstats
path: root/core/error.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/error.go')
-rw-r--r--core/error.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/core/error.go b/core/error.go
index 2bdad364f..3f3c350df 100644
--- a/core/error.go
+++ b/core/error.go
@@ -90,6 +90,23 @@ func IsNonceErr(err error) bool {
return ok
}
+// BlockNonceErr indicates that a block's nonce is invalid.
+type BlockNonceErr struct {
+ Number *big.Int
+ Hash common.Hash
+ Nonce uint64
+}
+
+func (err *BlockNonceErr) Error() string {
+ return fmt.Sprintf("block %d (%v) nonce is invalid (got %d)", err.Number, err.Hash, err.Nonce)
+}
+
+// IsBlockNonceErr returns true for invalid block nonce errors.
+func IsBlockNonceErr(err error) bool {
+ _, ok := err.(*BlockNonceErr)
+ return ok
+}
+
type InvalidTxErr struct {
Message string
}