From 7c8bfda2577edbf71f5460e0f3bee6fc5aaa58f4 Mon Sep 17 00:00:00 2001 From: Minh Doan Date: Sat, 15 Dec 2018 11:37:42 -0800 Subject: [PATCH] fix the timestamp --- services/explorer/service.go | 2 +- services/explorer/storage.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/services/explorer/service.go b/services/explorer/service.go index 9100369f9..93227aa3a 100644 --- a/services/explorer/service.go +++ b/services/explorer/service.go @@ -148,7 +148,7 @@ func GetTransaction(tx *types.Transaction, accountBlock *types.Block) Transactio } return Transaction{ ID: tx.Hash().Hex(), - Timestamp: strconv.Itoa(int(accountBlock.Size())), + Timestamp: strconv.Itoa(int(accountBlock.Time().Int64())), From: tx.To().Hex(), To: tx.To().Hex(), Value: strconv.Itoa(int(tx.GasPrice().Int64())), diff --git a/services/explorer/storage.go b/services/explorer/storage.go index d17a8cb32..8e90560c9 100644 --- a/services/explorer/storage.go +++ b/services/explorer/storage.go @@ -90,7 +90,7 @@ func (storage *Storage) Dump(accountBlock []byte, height uint32) { blockInfo := BlockInfo{ ID: block.Hash().Hex(), Height: string(height), - Timestamp: string(block.Time().Int64()), + Timestamp: strconv.Itoa(int(block.Time().Int64())), TXCount: string(block.Transactions().Len()), Size: block.Size().String(), }