Show block height in 'printchain' command

This commit is contained in:
Ivan Kuznetsov 2017-10-01 11:04:31 +07:00
parent 2734285450
commit 0c59d8cd52
1 changed files with 1 additions and 0 deletions

View File

@ -15,6 +15,7 @@ func (cli *CLI) printChain(nodeID string) {
block := bci.Next() block := bci.Next()
fmt.Printf("============ Block %x ============\n", block.Hash) fmt.Printf("============ Block %x ============\n", block.Hash)
fmt.Printf("Height: %d\n", block.Height)
fmt.Printf("Prev. block: %x\n", block.PrevBlockHash) fmt.Printf("Prev. block: %x\n", block.PrevBlockHash)
pow := NewProofOfWork(block) pow := NewProofOfWork(block)
fmt.Printf("PoW: %s\n\n", strconv.FormatBool(pow.Validate())) fmt.Printf("PoW: %s\n\n", strconv.FormatBool(pow.Validate()))