Don't mine transactions if they would go over the GasLimit implements ethereum/go-ethereum#77 further.

This commit is contained in:
Maran
2014-06-10 17:23:32 +02:00
parent 69044fe577
commit bdc206885a
2 changed files with 35 additions and 0 deletions

View File

@ -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