aboutsummaryrefslogtreecommitdiffstats
path: root/core/chain_manager.go
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/chain_manager.go
parente56cbc225ee822b6b57056c690ba24201528177d (diff)
downloadgo-tangerine-70b6174748585be2dd4b132203cda8655b76251b.tar
go-tangerine-70b6174748585be2dd4b132203cda8655b76251b.tar.gz
go-tangerine-70b6174748585be2dd4b132203cda8655b76251b.tar.bz2
go-tangerine-70b6174748585be2dd4b132203cda8655b76251b.tar.lz
go-tangerine-70b6174748585be2dd4b132203cda8655b76251b.tar.xz
go-tangerine-70b6174748585be2dd4b132203cda8655b76251b.tar.zst
go-tangerine-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/chain_manager.go')
-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())