aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2019-04-08 11:11:10 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 21:32:59 +0800
commit714b173e3618c97f109d6f23fd912ae7b1dc79af (patch)
tree72a2de4af89003c94d2b14a15105653dc1c14067
parent497d7a31d284682eb0214d75f04a366b44cc9c33 (diff)
downloaddexon-714b173e3618c97f109d6f23fd912ae7b1dc79af.tar.gz
dexon-714b173e3618c97f109d6f23fd912ae7b1dc79af.tar.zst
dexon-714b173e3618c97f109d6f23fd912ae7b1dc79af.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 8566c8f68..883fc8efd 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")
)
var (