core: skip genesis block for reprocess. Closes #1202

This commit is contained in:
obscuren 2015-06-09 13:22:16 +02:00
parent 11f65cf885
commit 190c1b688a
1 changed files with 10 additions and 5 deletions

View File

@ -1,6 +1,7 @@
package core package core
import ( import (
"fmt"
"math" "math"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
@ -75,15 +76,19 @@ func (self *Filter) Find() state.Logs {
var ( var (
logs state.Logs logs state.Logs
block = self.eth.ChainManager().GetBlockByNumber(latestBlockNo) 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 // Quit on latest
switch { switch {
case block.NumberU64() == earliestBlockNo, block.NumberU64() == 0: case block.NumberU64() == 0:
quit = true break done
case block.NumberU64() == earliestBlockNo:
break done
case self.max <= len(logs): case self.max <= len(logs):
break break done
} }
// Use bloom filtering to see if this block is interesting given the // Use bloom filtering to see if this block is interesting given the