From fed3e6a808921fb8274b50043c5c39a24a1bbccf Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 7 Jan 2015 13:17:48 +0100 Subject: Refactored ethutil.Config.Db out --- core/genesis.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'core/genesis.go') diff --git a/core/genesis.go b/core/genesis.go index 10b40516f..1590818a8 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -19,7 +19,7 @@ var ZeroHash512 = make([]byte, 64) var EmptyShaList = crypto.Sha3(ethutil.Encode([]interface{}{})) var EmptyListRoot = crypto.Sha3(ethutil.Encode("")) -func GenesisBlock() *types.Block { +func GenesisBlock(db ethutil.Database) *types.Block { genesis := types.NewBlock(ZeroHash256, ZeroHash160, nil, big.NewInt(131072), crypto.Sha3(big.NewInt(42).Bytes()), "") genesis.Header().Number = ethutil.Big0 genesis.Header().GasLimit = big.NewInt(1000000) @@ -30,7 +30,8 @@ func GenesisBlock() *types.Block { genesis.SetTransactions(types.Transactions{}) genesis.SetReceipts(types.Receipts{}) - statedb := state.New(genesis.Trie()) + statedb := state.New(genesis.Root(), db) + //statedb := state.New(genesis.Trie()) for _, addr := range []string{ "51ba59315b3a95761d0863b05ccc7a7f54703d99", "e4157b34ea9615cfbde6b4fda419828124b70c78", -- cgit v1.2.3 From b25126a277da5253e4ce175dec5b68ccdf1b9b0f Mon Sep 17 00:00:00 2001 From: obscuren Date: Thu, 8 Jan 2015 16:37:06 +0100 Subject: Minor fixed and additions for block proc * Path check length * Genesis include TD * Output TD on last block --- core/genesis.go | 1 + 1 file changed, 1 insertion(+) (limited to 'core/genesis.go') diff --git a/core/genesis.go b/core/genesis.go index 1590818a8..d9edaace2 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -25,6 +25,7 @@ func GenesisBlock(db ethutil.Database) *types.Block { genesis.Header().GasLimit = big.NewInt(1000000) genesis.Header().GasUsed = ethutil.Big0 genesis.Header().Time = 0 + genesis.Td = ethutil.Big0 genesis.SetUncles([]*types.Header{}) genesis.SetTransactions(types.Transactions{}) -- cgit v1.2.3