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.
This commit is contained in:
Felix Lange
2015-09-22 23:55:31 +02:00
parent e56cbc225e
commit 70b6174748
2 changed files with 1 additions and 6 deletions

View File

@ -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())