From bfde1a4305817e76b203c2fd6da4d6a7ca41e5f7 Mon Sep 17 00:00:00 2001 From: Gustav Simonsson Date: Mon, 14 Sep 2015 16:56:33 +0200 Subject: core: Add BadHashErr and test for BadHashes handling --- core/error.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'core/error.go') 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 +} -- cgit