diff options
author | obscuren <geffobscura@gmail.com> | 2014-12-02 18:37:33 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-12-02 18:37:33 +0800 |
commit | 99481a245adc2c4814ab6b38d94d63114f7bbb15 (patch) | |
tree | 947c32130249267c9cc0a9d0fd3b0a2bf77dda12 /chain/error.go | |
parent | 9f7a8ea5e696f1329d0ea2d0a679c385887ee149 (diff) | |
download | go-tangerine-99481a245adc2c4814ab6b38d94d63114f7bbb15.tar.gz go-tangerine-99481a245adc2c4814ab6b38d94d63114f7bbb15.tar.zst go-tangerine-99481a245adc2c4814ab6b38d94d63114f7bbb15.zip |
Check for known block err and ignore
Diffstat (limited to 'chain/error.go')
-rw-r--r-- | chain/error.go | 13 |
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 +} |