diff options
author | Gustav Simonsson <gustav.simonsson@gmail.com> | 2015-09-14 22:56:33 +0800 |
---|---|---|
committer | Gustav Simonsson <gustav.simonsson@gmail.com> | 2015-09-23 00:02:26 +0800 |
commit | bfde1a4305817e76b203c2fd6da4d6a7ca41e5f7 (patch) | |
tree | 0b31f5fd7d553e0334cea767cab8df14badba690 /core/error.go | |
parent | 36f46a61a7147ff9f98774c6c478eb965a9bea9c (diff) | |
download | go-tangerine-bfde1a4305817e76b203c2fd6da4d6a7ca41e5f7.tar go-tangerine-bfde1a4305817e76b203c2fd6da4d6a7ca41e5f7.tar.gz go-tangerine-bfde1a4305817e76b203c2fd6da4d6a7ca41e5f7.tar.bz2 go-tangerine-bfde1a4305817e76b203c2fd6da4d6a7ca41e5f7.tar.lz go-tangerine-bfde1a4305817e76b203c2fd6da4d6a7ca41e5f7.tar.xz go-tangerine-bfde1a4305817e76b203c2fd6da4d6a7ca41e5f7.tar.zst go-tangerine-bfde1a4305817e76b203c2fd6da4d6a7ca41e5f7.zip |
core: Add BadHashErr and test for BadHashes handling
Diffstat (limited to 'core/error.go')
-rw-r--r-- | core/error.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/core/error.go b/core/error.go index 09eea22d6..ff58d69d6 100644 --- a/core/error.go +++ b/core/error.go @@ -177,3 +177,14 @@ func IsValueTransferErr(e error) bool { _, ok := e.(*ValueTransferError) return ok } + +type BadHashError common.Hash + +func (h BadHashError) Error() string { + return fmt.Sprintf("Found known bad hash in chain %x", h) +} + +func IsBadHashError(err error) bool { + _, ok := err.(BadHashError) + return ok +} |