aboutsummaryrefslogtreecommitdiffstats
path: root/eth/backend.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-06-09 04:43:41 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-06-09 04:43:41 +0800
commit55b7c14554bc4faabc14aac6410b75f97c55cd4e (patch)
treef5a840d89417bb2b0273d8edd6d81b07299c3f58 /eth/backend.go
parent75522f95ce13b449123b60963ec1261d1e0507f1 (diff)
parent6244b10a8f74d92addf977994e5a9c0e457229bb (diff)
downloadgo-tangerine-55b7c14554bc4faabc14aac6410b75f97c55cd4e.tar
go-tangerine-55b7c14554bc4faabc14aac6410b75f97c55cd4e.tar.gz
go-tangerine-55b7c14554bc4faabc14aac6410b75f97c55cd4e.tar.bz2
go-tangerine-55b7c14554bc4faabc14aac6410b75f97c55cd4e.tar.lz
go-tangerine-55b7c14554bc4faabc14aac6410b75f97c55cd4e.tar.xz
go-tangerine-55b7c14554bc4faabc14aac6410b75f97c55cd4e.tar.zst
go-tangerine-55b7c14554bc4faabc14aac6410b75f97c55cd4e.zip
Merge pull request #1199 from obscuren/settable_genesis_nonce
core: settable genesis nonce
Diffstat (limited to 'eth/backend.go')
-rw-r--r--eth/backend.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/eth/backend.go b/eth/backend.go
index 3956dfcaa..06627416d 100644
--- a/eth/backend.go
+++ b/eth/backend.go
@@ -58,6 +58,7 @@ type Config struct {
Name string
ProtocolVersion int
NetworkId int
+ GenesisNonce int
BlockChainVersion int
SkipBcVersionCheck bool // e.g. blockchain export
@@ -284,7 +285,11 @@ func New(config *Config) (*Ethereum, error) {
}
eth.pow = ethash.New()
- eth.chainManager = core.NewChainManager(blockDb, stateDb, eth.pow, eth.EventMux())
+ genesis := core.GenesisBlock(uint64(config.GenesisNonce), blockDb)
+ eth.chainManager, err = core.NewChainManager(genesis, blockDb, stateDb, eth.pow, eth.EventMux())
+ if err != nil {
+ return nil, err
+ }
eth.downloader = downloader.New(eth.EventMux(), eth.chainManager.HasBlock, eth.chainManager.GetBlock)
eth.txPool = core.NewTxPool(eth.EventMux(), eth.chainManager.State, eth.chainManager.GasLimit)
eth.blockProcessor = core.NewBlockProcessor(stateDb, extraDb, eth.pow, eth.chainManager, eth.EventMux())