diff options
author | obscuren <geffobscura@gmail.com> | 2014-04-30 23:13:32 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-04-30 23:13:32 +0800 |
commit | c3293641e7b49c7e2d85d2bd69b37bc74cb5b00d (patch) | |
tree | 123df111bb4680aca93cd34471705c19432d3b8a /ethchain/error.go | |
parent | 21724f7ef960f0f2df0d2b0f3cccfd030a4aaee8 (diff) | |
download | go-tangerine-c3293641e7b49c7e2d85d2bd69b37bc74cb5b00d.tar.gz go-tangerine-c3293641e7b49c7e2d85d2bd69b37bc74cb5b00d.tar.zst go-tangerine-c3293641e7b49c7e2d85d2bd69b37bc74cb5b00d.zip |
Removed debug logging
Diffstat (limited to 'ethchain/error.go')
-rw-r--r-- | ethchain/error.go | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/ethchain/error.go b/ethchain/error.go index 0f1d061c0..8d37b0208 100644 --- a/ethchain/error.go +++ b/ethchain/error.go @@ -1,6 +1,8 @@ package ethchain -import "fmt" +import ( + "fmt" +) // Parent error. In case a parent is unknown this error will be thrown // by the block manager @@ -40,3 +42,22 @@ func IsValidationErr(err error) bool { return ok } + +type NonceErr struct { + Message string + Is, Exp uint64 +} + +func (err *NonceErr) Error() string { + return err.Message +} + +func NonceError(is, exp uint64) *NonceErr { + return &NonceErr{Message: fmt.Sprintf("Nonce err. Is %d, expected %d", is, exp), Is: is, Exp: exp} +} + +func IsNonceErr(err error) bool { + _, ok := err.(*NonceErr) + + return ok +} |