aboutsummaryrefslogtreecommitdiffstats
path: root/chain/error.go
diff options
context:
space:
mode:
Diffstat (limited to 'chain/error.go')
-rw-r--r--chain/error.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/chain/error.go b/chain/error.go
index 204b8b873..71bda8e7b 100644
--- a/chain/error.go
+++ b/chain/error.go
@@ -114,3 +114,15 @@ func IsOutOfGasErr(err error) bool {
return ok
}
+
+type TDError struct {
+ a, b *big.Int
+}
+
+func (self *TDError) Error() string {
+ return fmt.Sprintf("incoming chain has a lower or equal TD (%v <= %v)", self.a, self.b)
+}
+func IsTDError(e error) bool {
+ _, ok := err.(*TDError)
+ return ok
+}