From af73d1d6823565c5bf8cc02d6f110bcc1edb2d99 Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 29 Apr 2015 12:40:05 +0200 Subject: core/types: added fake parent hash / hash to String() output --- core/types/block.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'core/types') diff --git a/core/types/block.go b/core/types/block.go index fa83fc8e8..19cf49c12 100644 --- a/core/types/block.go +++ b/core/types/block.go @@ -351,7 +351,7 @@ func (self *Block) Copy() *Block { } func (self *Block) String() string { - return fmt.Sprintf(`Block(#%v): Size: %v TD: %v { + str := fmt.Sprintf(`Block(#%v): Size: %v TD: %v { MinerHash: %x %v Transactions: @@ -360,6 +360,16 @@ Uncles: %v } `, self.Number(), self.Size(), self.Td, self.header.HashNoNonce(), self.header, self.transactions, self.uncles) + + if (self.HeaderHash != common.Hash{}) { + str += fmt.Sprintf("\nFake hash = %x", self.HeaderHash) + } + + if (self.ParentHeaderHash != common.Hash{}) { + str += fmt.Sprintf("\nFake parent hash = %x", self.ParentHeaderHash) + } + + return str } func (self *Header) String() string { -- cgit v1.2.3