From c0accf31e0409e729ae8560f6a0b14dd1ff92a73 Mon Sep 17 00:00:00 2001 From: Wei Yang Date: Wed, 11 Oct 2017 23:19:44 +0800 Subject: [PATCH] cli: show timestamp of the block --- cli_printchain.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cli_printchain.go b/cli_printchain.go index 81b7edf..6c344de 100644 --- a/cli_printchain.go +++ b/cli_printchain.go @@ -3,6 +3,7 @@ package main import ( "fmt" "strconv" + "time" ) func (cli *CLI) printChain(nodeID string) { @@ -17,6 +18,7 @@ func (cli *CLI) printChain(nodeID string) { fmt.Printf("============ Block %x ============\n", block.Hash) fmt.Printf("Height: %d\n", block.Height) fmt.Printf("Prev. block: %x\n", block.PrevBlockHash) + fmt.Printf("Created at : %s\n", time.Unix(block.Timestamp, 0)) pow := NewProofOfWork(block) fmt.Printf("PoW: %s\n\n", strconv.FormatBool(pow.Validate())) for _, tx := range block.Transactions {