aboutsummaryrefslogtreecommitdiffstats
path: root/core/chain_manager.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/chain_manager.go')
-rw-r--r--core/chain_manager.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/chain_manager.go b/core/chain_manager.go
index 5ad1dda83..25ee0eeef 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
}