core: settable genesis nonce

You can set the nonce of the block with `--genesisnonce`. When the
genesis nonce changes and it doesn't match with the first block in your
database it will fail. A new `datadir` must be given if the nonce of the
genesis block changes.
This commit is contained in:
obscuren
2015-06-08 12:12:13 +02:00
parent c6faa18ec9
commit 6244b10a8f
9 changed files with 84 additions and 28 deletions

View File

@ -1,6 +1,7 @@
package core
import (
"fmt"
"math/big"
"testing"
@ -16,7 +17,11 @@ func proc() (*BlockProcessor, *ChainManager) {
db, _ := ethdb.NewMemDatabase()
var mux event.TypeMux
chainMan := NewChainManager(db, db, thePow(), &mux)
genesis := GenesisBlock(0, db)
chainMan, err := NewChainManager(genesis, db, db, thePow(), &mux)
if err != nil {
fmt.Println(err)
}
return NewBlockProcessor(db, db, ezp.New(), chainMan, &mux), chainMan
}