diff options
author | Mission Liao <mission.liao@dexon.org> | 2019-03-21 13:18:39 +0800 |
---|---|---|
committer | Mission Liao <mission.liao@dexon.org> | 2019-03-21 13:18:39 +0800 |
commit | 0018ef629273757536575beae0965c1f0c75a430 (patch) | |
tree | c3a19181c48ed0eb096002a5c2249b92fcd0bac6 | |
parent | e83a0cf685d537b0f5326c3f4aff26a2e642ca96 (diff) | |
download | dexon-consensus-0018ef629273757536575beae0965c1f0c75a430.tar.gz dexon-consensus-0018ef629273757536575beae0965c1f0c75a430.tar.zst dexon-consensus-0018ef629273757536575beae0965c1f0c75a430.zip |
Tmp
-rw-r--r-- | core/types/block.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/types/block.go b/core/types/block.go index 2b23e96..f4fc8b6 100644 --- a/core/types/block.go +++ b/core/types/block.go @@ -21,6 +21,7 @@ package types import ( "bytes" + "encoding/hex" "fmt" "io" "time" @@ -193,7 +194,10 @@ func (b *Block) DecodeRLP(s *rlp.Stream) error { } func (b *Block) String() string { - return fmt.Sprintf("Block{Hash:%v %s}", b.Hash.String()[:6], b.Position) + if len(b.Finalization.Randomness) == 0 { + return fmt.Sprintf("Block{Hash:%v %s}", b.Hash.String()[:6], b.Position) + } + return fmt.Sprintf("Block{Hash:%v %s %s}", b.Hash.String()[:6], b.Position, hex.EncodeToString(r.Randomness)[:6]) } // Clone returns a deep copy of a block. |