aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/error.go
diff options
context:
space:
mode:
authorMaran <maran.hidskes@gmail.com>2014-06-10 23:23:32 +0800
committerMaran <maran.hidskes@gmail.com>2014-06-10 23:23:32 +0800
commitbdc206885a1d9c730464f60ec65557403720be1e (patch)
tree2686f3c960f6f2966f44d014e4143fa41eb84edd /ethchain/error.go
parent69044fe5774840a49de3f881a490db52e907affb (diff)
downloaddexon-bdc206885a1d9c730464f60ec65557403720be1e.tar
dexon-bdc206885a1d9c730464f60ec65557403720be1e.tar.gz
dexon-bdc206885a1d9c730464f60ec65557403720be1e.tar.bz2
dexon-bdc206885a1d9c730464f60ec65557403720be1e.tar.lz
dexon-bdc206885a1d9c730464f60ec65557403720be1e.tar.xz
dexon-bdc206885a1d9c730464f60ec65557403720be1e.tar.zst
dexon-bdc206885a1d9c730464f60ec65557403720be1e.zip
Don't mine transactions if they would go over the GasLimit implements ethereum/go-ethereum#77 further.
Diffstat (limited to 'ethchain/error.go')
-rw-r--r--ethchain/error.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/ethchain/error.go b/ethchain/error.go
index 8d37b0208..29896bc59 100644
--- a/ethchain/error.go
+++ b/ethchain/error.go
@@ -2,6 +2,7 @@ package ethchain
import (
"fmt"
+ "math/big"
)
// Parent error. In case a parent is unknown this error will be thrown
@@ -43,6 +44,23 @@ func IsValidationErr(err error) bool {
return ok
}
+type GasLimitErr struct {
+ Message string
+ Is, Max *big.Int
+}
+
+func IsGasLimitErr(err error) bool {
+ _, ok := err.(*GasLimitErr)
+
+ return ok
+}
+func (err *GasLimitErr) Error() string {
+ return err.Message
+}
+func GasLimitError(is, max *big.Int) *GasLimitErr {
+ return &GasLimitErr{Message: fmt.Sprintf("GasLimit error. Max %s, transaction would take it to %s", max, is), Is: is, Max: max}
+}
+
type NonceErr struct {
Message string
Is, Exp uint64