aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2019-04-08 11:11:10 +0800
committerWei-Ning Huang <w@byzantine-lab.io>2019-06-15 22:09:55 +0800
commit011258cbd51600f44846a1650627a92afc21086a (patch)
treeb3624996687c6575339073d4bd8079b0872b41ae
parent2b6c8c733a52f686c7f418bb5218f53aa8c19a8d (diff)
downloadgo-tangerine-011258cbd51600f44846a1650627a92afc21086a.tar
go-tangerine-011258cbd51600f44846a1650627a92afc21086a.tar.gz
go-tangerine-011258cbd51600f44846a1650627a92afc21086a.tar.bz2
go-tangerine-011258cbd51600f44846a1650627a92afc21086a.tar.lz
go-tangerine-011258cbd51600f44846a1650627a92afc21086a.tar.xz
go-tangerine-011258cbd51600f44846a1650627a92afc21086a.tar.zst
go-tangerine-011258cbd51600f44846a1650627a92afc21086a.zip
core: fix genesis timestamp (#338)
-rw-r--r--console/console.go2
-rw-r--r--core/genesis.go8
-rw-r--r--params/config.go8
3 files changed, 9 insertions, 9 deletions
diff --git a/console/console.go b/console/console.go
index c36b2e0c4..898a945e2 100644
--- a/console/console.go
+++ b/console/console.go
@@ -278,7 +278,7 @@ func (c *Console) Welcome() {
fmt.Fprintf(c.printer, "Welcome to the Geth JavaScript console!\n\n")
c.jsre.Run(`
console.log("instance: " + web3.version.node);
- console.log("at block: " + eth.blockNumber + " (" + new Date(1000 * eth.getBlock(eth.blockNumber).timestamp) + ")");
+ console.log("at block: " + eth.blockNumber + " (" + new Date(eth.getBlock(eth.blockNumber).timestamp) + ")");
console.log(" datadir: " + admin.datadir);
`)
// List all the supported modules for the user to call
diff --git a/core/genesis.go b/core/genesis.go
index 10585bab4..f9426212e 100644
--- a/core/genesis.go
+++ b/core/genesis.go
@@ -384,7 +384,7 @@ func GenesisBlockForTesting(db ethdb.Database, addr common.Address, balance *big
func DefaultGenesisBlock() *Genesis {
return &Genesis{
Config: params.MainnetChainConfig,
- Timestamp: params.MainnetChainConfig.DMoment,
+ Timestamp: params.MainnetChainConfig.DMoment * 1000,
Nonce: 0x42,
ExtraData: hexutil.MustDecode("0x5765692d4e696e6720536f6e696320426f6a696520323031382d31302d32302e"),
GasLimit: 40000000,
@@ -397,7 +397,7 @@ func DefaultGenesisBlock() *Genesis {
func DefaultTestnetGenesisBlock() *Genesis {
return &Genesis{
Config: params.TestnetChainConfig,
- Timestamp: params.TestnetChainConfig.DMoment,
+ Timestamp: params.TestnetChainConfig.DMoment * 1000,
Nonce: 0x42,
ExtraData: hexutil.MustDecode("0x3535353535353535353535353535353535353535353535353535353535353535"),
GasLimit: 40000000,
@@ -410,7 +410,7 @@ func DefaultTestnetGenesisBlock() *Genesis {
func DefaultTaipeiGenesisBlock() *Genesis {
return &Genesis{
Config: params.TaipeiChainConfig,
- Timestamp: params.TaipeiChainConfig.DMoment,
+ Timestamp: params.TaipeiChainConfig.DMoment * 1000,
Nonce: 0x42,
ExtraData: hexutil.MustDecode("0x3535353535353535353535353535353535353535353535353535353535353535"),
GasLimit: 40000000,
@@ -423,7 +423,7 @@ func DefaultTaipeiGenesisBlock() *Genesis {
func DefaultYilanGenesisBlock() *Genesis {
return &Genesis{
Config: params.YilanChainConfig,
- Timestamp: params.YilanChainConfig.DMoment,
+ Timestamp: params.YilanChainConfig.DMoment * 1000,
Nonce: 0x42,
ExtraData: hexutil.MustDecode("0x3535353535353535353535353535353535353535353535353535353535353535"),
GasLimit: 40000000,
diff --git a/params/config.go b/params/config.go
index c740ed246..b4bb19fba 100644
--- a/params/config.go
+++ b/params/config.go
@@ -26,10 +26,10 @@ import (
// Genesis hashes to enforce below configs on.
var (
- MainnetGenesisHash = common.HexToHash("0x704a63495d74c51adc6c053c6303065124690065ac6f942b13dc9b1a6f094143")
- TestnetGenesisHash = common.HexToHash("0x22a8128aee762ceb6c4f848e38cc5a07e5fa92fcce9a5618dd1c90c00bc89b3a")
- TaipeiGenesisHash = common.HexToHash("0x8d0ceb3cd2b59e3c7f3a229e148ad5192055c234da3628715ff7aa5fb598b390")
- YilanGenesisHash = common.HexToHash("0xad24a02194aa8239fd1a14d77d0c905c306bbac8ec69125b442b8e8dbd1e486b")
+ MainnetGenesisHash = common.HexToHash("0x55f87cf5428a78a015d06088cb76b4f50afa7b081a45a25dbf0ae7ffb2366b98")
+ TestnetGenesisHash = common.HexToHash("0xa2e8d6813569c389f620b56e838d335d0db405250286a552201793e48badc47b")
+ TaipeiGenesisHash = common.HexToHash("0xec0bff2d28a4cb4a2b6a689ee71f450ec56d0438d0fcb4ef18c4c6a231dc8df4")
+ YilanGenesisHash = common.HexToHash("0x6618f722c32f044ecd9ce09f02efc9757744762a6d7e12c4bd0aedc6b83ae92b")
)
// TrustedCheckpoints associates each known checkpoint with the genesis hash of