From abffdd7a5e23316403779dda6bd99909dd1a031b Mon Sep 17 00:00:00 2001 From: Wei-Ning Huang Date: Sun, 17 Mar 2019 10:43:10 +0800 Subject: core: fill in genesis timstamp and remove dMoment from protocol handshake (#263) Fill in dmoment as genesis block timestamp. This allow us to remove dMoment check from protocol handshake since genesis block hash itself will protect us against different dMoment. --- cmd/gdex/consolecmd_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cmd') diff --git a/cmd/gdex/consolecmd_test.go b/cmd/gdex/consolecmd_test.go index 672735d2c..c1174f9e6 100644 --- a/cmd/gdex/consolecmd_test.go +++ b/cmd/gdex/consolecmd_test.go @@ -51,7 +51,7 @@ func TestConsoleWelcome(t *testing.T) { gdex.SetTemplateFunc("goarch", func() string { return runtime.GOARCH }) gdex.SetTemplateFunc("gover", runtime.Version) gdex.SetTemplateFunc("gethver", func() string { return params.VersionWithMeta }) - gdex.SetTemplateFunc("dextime", func() string { return time.Unix(1540024964, 0).Format(time.RFC1123) }) + gdex.SetTemplateFunc("dextime", func() string { return time.Unix(int64(params.MainnetChainConfig.DMoment), 0).Format(time.RFC1123) }) gdex.SetTemplateFunc("apis", func() string { return ipcAPIs }) // Verify the actual welcome message to the required template @@ -134,7 +134,7 @@ func testAttachWelcome(t *testing.T, gdex *testgdex, endpoint, apis string) { attach.SetTemplateFunc("gover", runtime.Version) attach.SetTemplateFunc("gethver", func() string { return params.VersionWithMeta }) attach.SetTemplateFunc("etherbase", func() string { return gdex.Etherbase }) - attach.SetTemplateFunc("dextime", func() string { return time.Unix(1540024964, 0).Format(time.RFC1123) }) + attach.SetTemplateFunc("dextime", func() string { return time.Unix(int64(params.MainnetChainConfig.DMoment), 0).Format(time.RFC1123) }) attach.SetTemplateFunc("ipc", func() bool { return strings.HasPrefix(endpoint, "ipc") }) attach.SetTemplateFunc("datadir", func() string { return gdex.Datadir }) attach.SetTemplateFunc("apis", func() string { return apis }) -- cgit v1.2.3