aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-09-23 05:55:31 +0800
committerFelix Lange <fjl@twurst.com>2015-09-23 05:55:31 +0800
commit70b6174748585be2dd4b132203cda8655b76251b (patch)
tree21e438c0023862e331e7c9f5d10568d52faae889 /core
parente56cbc225ee822b6b57056c690ba24201528177d (diff)
downloaddexon-70b6174748585be2dd4b132203cda8655b76251b.tar.gz
dexon-70b6174748585be2dd4b132203cda8655b76251b.tar.zst
dexon-70b6174748585be2dd4b132203cda8655b76251b.zip
cmd/geth, core: make "geth blocktest" work again
The test genesis block was not written properly, block insertion failed immediately. While here, fix the panic when shutting down "geth blocktest" with Ctrl+C. The signal handler is now installed automatically, causing ethereum.Stop to crash because everything is already stopped.
Diffstat (limited to 'core')
-rw-r--r--core/chain_manager.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/chain_manager.go b/core/chain_manager.go
index 42f70af33..0ad4f86f9 100644
--- a/core/chain_manager.go
+++ b/core/chain_manager.go
@@ -279,6 +279,7 @@ func (bc *ChainManager) ResetWithGenesisBlock(genesis *types.Block) {
if err := WriteBlock(bc.chainDb, genesis); err != nil {
glog.Fatalf("failed to write genesis block: %v", err)
}
+ bc.genesisBlock = genesis
bc.insert(bc.genesisBlock)
bc.currentBlock = bc.genesisBlock
bc.setTotalDifficulty(genesis.Difficulty())