diff options
author | obscuren <geffobscura@gmail.com> | 2015-05-18 22:04:10 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-05-19 00:16:53 +0800 |
commit | 59c0d014189db1b85f45ef17f458bcbc20c267b2 (patch) | |
tree | c26eef2e7b9e32b6534228ad82fafbc6b258d77e | |
parent | bc5e60cd632b7ee38eb0ea9dcd80e1ca9a4ba4af (diff) | |
download | dexon-59c0d014189db1b85f45ef17f458bcbc20c267b2.tar dexon-59c0d014189db1b85f45ef17f458bcbc20c267b2.tar.gz dexon-59c0d014189db1b85f45ef17f458bcbc20c267b2.tar.bz2 dexon-59c0d014189db1b85f45ef17f458bcbc20c267b2.tar.lz dexon-59c0d014189db1b85f45ef17f458bcbc20c267b2.tar.xz dexon-59c0d014189db1b85f45ef17f458bcbc20c267b2.tar.zst dexon-59c0d014189db1b85f45ef17f458bcbc20c267b2.zip |
core: chain manager no longer exports genesis block
-rw-r--r-- | cmd/geth/js_test.go | 2 | ||||
-rw-r--r-- | core/chain_manager.go | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/cmd/geth/js_test.go b/cmd/geth/js_test.go index e02e8f704..6368efbfc 100644 --- a/cmd/geth/js_test.go +++ b/cmd/geth/js_test.go @@ -172,6 +172,8 @@ func TestBlockChain(t *testing.T) { tmpfile := filepath.Join(extmp, "export.chain") tmpfileq := strconv.Quote(tmpfile) + ethereum.ChainManager().Reset() + checkEvalJSON(t, repl, `admin.export(`+tmpfileq+`)`, `true`) if _, err := os.Stat(tmpfile); err != nil { t.Fatal(err) diff --git a/core/chain_manager.go b/core/chain_manager.go index 355e203c7..7dff7dffd 100644 --- a/core/chain_manager.go +++ b/core/chain_manager.go @@ -348,7 +348,7 @@ func (self *ChainManager) Export(w io.Writer) error { last := self.currentBlock.NumberU64() - for nr := uint64(0); nr <= last; nr++ { + for nr := uint64(1); nr <= last; nr++ { block := self.GetBlockByNumber(nr) if block == nil { return fmt.Errorf("export failed on #%d: not found", nr) @@ -789,7 +789,7 @@ func verifyNonces(pow pow.PoW, blocks []*types.Block) error { func verifyNonce(pow pow.PoW, in <-chan *types.Block, done chan<- error) { for block := range in { if !pow.Verify(block) { - done <- ValidationError("Block's nonce is invalid (= %x)", block.Nonce) + done <- ValidationError("Block(#%v) nonce is invalid (= %x)", block.Number(), block.Nonce) } else { done <- nil } |