aboutsummaryrefslogtreecommitdiffstats
path: root/chain/error.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-12-02 18:52:56 +0800
committerobscuren <geffobscura@gmail.com>2014-12-02 18:52:56 +0800
commit64f35ba8d1f31d6821a0a1bf946c71396a996f30 (patch)
tree375a081536c7c0b329a3b0c2e812ff05f81dd64c /chain/error.go
parent616066a598933df7ef126186eb9c647094f665ca (diff)
parent99481a245adc2c4814ab6b38d94d63114f7bbb15 (diff)
downloadgo-tangerine-64f35ba8d1f31d6821a0a1bf946c71396a996f30.tar
go-tangerine-64f35ba8d1f31d6821a0a1bf946c71396a996f30.tar.gz
go-tangerine-64f35ba8d1f31d6821a0a1bf946c71396a996f30.tar.bz2
go-tangerine-64f35ba8d1f31d6821a0a1bf946c71396a996f30.tar.lz
go-tangerine-64f35ba8d1f31d6821a0a1bf946c71396a996f30.tar.xz
go-tangerine-64f35ba8d1f31d6821a0a1bf946c71396a996f30.tar.zst
go-tangerine-64f35ba8d1f31d6821a0a1bf946c71396a996f30.zip
merge errors fixed
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
+}