diff options
author | obscuren <geffobscura@gmail.com> | 2015-04-20 22:02:50 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-04-20 22:02:50 +0800 |
commit | 72d065d49102dd07c929d1e147186604c5e4ab05 (patch) | |
tree | db62f3c8eabf88269707eaba69b0755b920df50a /core/chain_manager.go | |
parent | 97a9753f87cce4f0072feba63f2e137138a16063 (diff) | |
download | go-tangerine-72d065d49102dd07c929d1e147186604c5e4ab05.tar.gz go-tangerine-72d065d49102dd07c929d1e147186604c5e4ab05.tar.zst go-tangerine-72d065d49102dd07c929d1e147186604c5e4ab05.zip |
core: force block process & fixed chain manager test
Diffstat (limited to 'core/chain_manager.go')
-rw-r--r-- | core/chain_manager.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/chain_manager.go b/core/chain_manager.go index dcd8df28f..3f2b3a26a 100644 --- a/core/chain_manager.go +++ b/core/chain_manager.go @@ -322,7 +322,12 @@ func (self *ChainManager) Export(w io.Writer) error { last := self.currentBlock.NumberU64() for nr := uint64(0); nr <= last; nr++ { - if err := self.GetBlockByNumber(nr).EncodeRLP(w); err != nil { + block := self.GetBlockByNumber(nr) + if block == nil { + return fmt.Errorf("export failed on #%d: not found", nr) + } + + if err := block.EncodeRLP(w); err != nil { return err } } |