aboutsummaryrefslogtreecommitdiffstats
path: root/chain/error.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-11-04 20:00:47 +0800
committerobscuren <geffobscura@gmail.com>2014-11-04 20:00:47 +0800
commita9db1ee8d45b3395df13b27a901567fde310a3c7 (patch)
tree6160365d6ee20559e6fabf3d115229983ccd4fdf /chain/error.go
parent699dcaf65ced99517724984f5930845417cfdfca (diff)
downloadgo-tangerine-a9db1ee8d45b3395df13b27a901567fde310a3c7.tar.gz
go-tangerine-a9db1ee8d45b3395df13b27a901567fde310a3c7.tar.zst
go-tangerine-a9db1ee8d45b3395df13b27a901567fde310a3c7.zip
Replaced to return the td and throw a specific error on TD
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
+}