diff options
author | obscuren <geffobscura@gmail.com> | 2015-04-29 18:40:05 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-04-29 18:51:05 +0800 |
commit | af73d1d6823565c5bf8cc02d6f110bcc1edb2d99 (patch) | |
tree | 5b8fe478e0398d34410868e11a8639bac01e725f /core/types | |
parent | 4b7bdc3766e1e06ebd6f865f0fdda26f9b331932 (diff) | |
download | go-tangerine-af73d1d6823565c5bf8cc02d6f110bcc1edb2d99.tar go-tangerine-af73d1d6823565c5bf8cc02d6f110bcc1edb2d99.tar.gz go-tangerine-af73d1d6823565c5bf8cc02d6f110bcc1edb2d99.tar.bz2 go-tangerine-af73d1d6823565c5bf8cc02d6f110bcc1edb2d99.tar.lz go-tangerine-af73d1d6823565c5bf8cc02d6f110bcc1edb2d99.tar.xz go-tangerine-af73d1d6823565c5bf8cc02d6f110bcc1edb2d99.tar.zst go-tangerine-af73d1d6823565c5bf8cc02d6f110bcc1edb2d99.zip |
core/types: added fake parent hash / hash to String() output
Diffstat (limited to 'core/types')
-rw-r--r-- | core/types/block.go | 12 |
1 files changed, 11 insertions, 1 deletions
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 { |