aboutsummaryrefslogtreecommitdiffstats
path: root/core/genesis.go
diff options
context:
space:
mode:
authorGustav Simonsson <gustav.simonsson@gmail.com>2015-04-02 11:17:15 +0800
committerGustav Simonsson <gustav.simonsson@gmail.com>2015-04-02 12:22:32 +0800
commitc26c8d3a44cdd45994b6d99777d620565bab8f9c (patch)
tree6ab5a74981e9fb9f869f1ef884a375163b898113 /core/genesis.go
parent516ec28544e0f9c76e18d82742d3ae58cfb59cc1 (diff)
downloaddexon-c26c8d3a44cdd45994b6d99777d620565bab8f9c.tar
dexon-c26c8d3a44cdd45994b6d99777d620565bab8f9c.tar.gz
dexon-c26c8d3a44cdd45994b6d99777d620565bab8f9c.tar.bz2
dexon-c26c8d3a44cdd45994b6d99777d620565bab8f9c.tar.lz
dexon-c26c8d3a44cdd45994b6d99777d620565bab8f9c.tar.xz
dexon-c26c8d3a44cdd45994b6d99777d620565bab8f9c.tar.zst
dexon-c26c8d3a44cdd45994b6d99777d620565bab8f9c.zip
Read most protocol params from common/params.json
* Add params package with exported variables generated from github.com/ethereum/common/blob/master/params.json * Use params package variables in applicable places * Add check for minimum gas limit in validation of block's gas limit * Remove common/params.json from go-ethereum to avoid outdated version of it
Diffstat (limited to 'core/genesis.go')
-rw-r--r--core/genesis.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/core/genesis.go b/core/genesis.go
index 7958157a4..13656c40c 100644
--- a/core/genesis.go
+++ b/core/genesis.go
@@ -3,12 +3,12 @@ package core
import (
"encoding/json"
"fmt"
- "math/big"
"os"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
+ "github.com/ethereum/go-ethereum/params"
)
/*
@@ -18,13 +18,11 @@ import (
var ZeroHash256 = make([]byte, 32)
var ZeroHash160 = make([]byte, 20)
var ZeroHash512 = make([]byte, 64)
-var GenesisDiff = big.NewInt(131072)
-var GenesisGasLimit = big.NewInt(3141592)
func GenesisBlock(db common.Database) *types.Block {
- genesis := types.NewBlock(common.Hash{}, common.Address{}, common.Hash{}, GenesisDiff, 42, "")
+ genesis := types.NewBlock(common.Hash{}, common.Address{}, common.Hash{}, params.GenesisDifficulty, 42, "")
genesis.Header().Number = common.Big0
- genesis.Header().GasLimit = GenesisGasLimit
+ genesis.Header().GasLimit = params.GenesisGasLimit
genesis.Header().GasUsed = common.Big0
genesis.Header().Time = 0