diff options
author | obscuren <geffobscura@gmail.com> | 2014-11-04 20:00:47 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-11-04 20:00:47 +0800 |
commit | a9db1ee8d45b3395df13b27a901567fde310a3c7 (patch) | |
tree | 6160365d6ee20559e6fabf3d115229983ccd4fdf /chain/error.go | |
parent | 699dcaf65ced99517724984f5930845417cfdfca (diff) | |
download | go-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.go | 12 |
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 +} |