aboutsummaryrefslogtreecommitdiffstats
path: root/chain/error.go
diff options
context:
space:
mode:
Diffstat (limited to 'chain/error.go')
-rw-r--r--chain/error.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/chain/error.go b/chain/error.go
index 540eda95a..7dce2b608 100644
--- a/chain/error.go
+++ b/chain/error.go
@@ -126,3 +126,16 @@ func IsTDError(e error) bool {
_, ok := e.(*TDError)
return ok
}
+
+type KnownBlockError struct {
+ number uint64
+ hash []byte
+}
+
+func (self *KnownBlockError) Error() string {
+ return fmt.Sprintf("block %d already known (%x)", self.number, self.hash[0:4])
+}
+func IsKnownBlockErr(e error) bool {
+ _, ok := e.(*KnownBlockError)
+ return ok
+}