aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-04-13 23:35:46 +0800
committerobscuren <geffobscura@gmail.com>2015-04-13 23:35:46 +0800
commit333e539ce2143e9f416cef45053c1c21ce0312d4 (patch)
treeda21c5ca613615f78e7475f67e743c6d9464d1cb /core
parenta8a2b2a488f7433abc09c51b751556875c9107a9 (diff)
parent1fa844aaf51beae9129b52a52f51b6602c52ccdb (diff)
downloaddexon-333e539ce2143e9f416cef45053c1c21ce0312d4.tar
dexon-333e539ce2143e9f416cef45053c1c21ce0312d4.tar.gz
dexon-333e539ce2143e9f416cef45053c1c21ce0312d4.tar.bz2
dexon-333e539ce2143e9f416cef45053c1c21ce0312d4.tar.lz
dexon-333e539ce2143e9f416cef45053c1c21ce0312d4.tar.xz
dexon-333e539ce2143e9f416cef45053c1c21ce0312d4.tar.zst
dexon-333e539ce2143e9f416cef45053c1c21ce0312d4.zip
Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop
Diffstat (limited to 'core')
-rw-r--r--core/block_processor.go6
-rw-r--r--core/chain_manager.go8
2 files changed, 12 insertions, 2 deletions
diff --git a/core/block_processor.go b/core/block_processor.go
index 7aded346a..d5a29b258 100644
--- a/core/block_processor.go
+++ b/core/block_processor.go
@@ -18,6 +18,12 @@ import (
"gopkg.in/fatih/set.v0"
)
+const (
+ // must be bumped when consensus algorithm is changed, this forces the upgradedb
+ // command to be run (forces the blocks to be imported again using the new algorithm)
+ BlockChainVersion = 1
+)
+
var statelogger = logger.NewLogger("BLOCK")
type BlockProcessor struct {
diff --git a/core/chain_manager.go b/core/chain_manager.go
index 5ad1dda83..721c008bc 100644
--- a/core/chain_manager.go
+++ b/core/chain_manager.go
@@ -284,11 +284,14 @@ func (self *ChainManager) Export(w io.Writer) error {
defer self.mu.RUnlock()
glog.V(logger.Info).Infof("exporting %v blocks...\n", self.currentBlock.Header().Number)
- for block := self.currentBlock; block != nil; block = self.GetBlock(block.Header().ParentHash) {
- if err := block.EncodeRLP(w); err != nil {
+ last := self.currentBlock.NumberU64()
+
+ for nr := uint64(0); nr <= last; nr++ {
+ if err := self.GetBlockByNumber(nr).EncodeRLP(w); err != nil {
return err
}
}
+
return nil
}
@@ -470,6 +473,7 @@ func (self *ChainManager) InsertChain(chain types.Blocks) error {
}
if IsParentErr(err) && self.futureBlocks.Has(block.ParentHash()) {
+ block.SetQueued(true)
self.futureBlocks.Push(block)
stats.queued++
continue