aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-06-09 19:46:13 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-06-09 19:46:13 +0800
commit3054fd481175286591e5d867ec119e9151d02cb8 (patch)
treeb58411739b726993c5e1367421e6b2848ebfe91a
parent7da8ebdfd0a4fd64e602feb0f7b099d1441e307a (diff)
parent190c1b688afa1b834ba1ccd7d0b7501bfaedbd18 (diff)
downloadgo-tangerine-3054fd481175286591e5d867ec119e9151d02cb8.tar.gz
go-tangerine-3054fd481175286591e5d867ec119e9151d02cb8.tar.zst
go-tangerine-3054fd481175286591e5d867ec119e9151d02cb8.zip
Merge pull request #1215 from obscuren/issue1202
core: skip genesis block for reprocess. Closes #1202
-rw-r--r--core/filter.go15
1 files changed, 10 insertions, 5 deletions
diff --git a/core/filter.go b/core/filter.go
index 2ca57da65..fcdf68dd0 100644
--- a/core/filter.go
+++ b/core/filter.go
@@ -1,6 +1,7 @@
package core
import (
+ "fmt"
"math"
"github.com/ethereum/go-ethereum/common"
@@ -75,15 +76,19 @@ func (self *Filter) Find() state.Logs {
var (
logs state.Logs
block = self.eth.ChainManager().GetBlockByNumber(latestBlockNo)
- quit bool
)
- for i := 0; !quit && block != nil; i++ {
+
+done:
+ for i := 0; block != nil; i++ {
+ fmt.Println(block.NumberU64() == 0)
// Quit on latest
switch {
- case block.NumberU64() == earliestBlockNo, block.NumberU64() == 0:
- quit = true
+ case block.NumberU64() == 0:
+ break done
+ case block.NumberU64() == earliestBlockNo:
+ break done
case self.max <= len(logs):
- break
+ break done
}
// Use bloom filtering to see if this block is interesting given the