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:
@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user