aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-08-25 18:53:06 +0800
committerobscuren <geffobscura@gmail.com>2014-08-25 18:53:06 +0800
commit6afc16399f9624663579ad72950b4ea3b887db57 (patch)
tree34a2077e34ca34be1e9a51b61923ac40d7b76b5e /ethchain
parent3f904bf3acb5779f68834ebca95825ea1990f85b (diff)
downloadgo-tangerine-6afc16399f9624663579ad72950b4ea3b887db57.tar.gz
go-tangerine-6afc16399f9624663579ad72950b4ea3b887db57.tar.zst
go-tangerine-6afc16399f9624663579ad72950b4ea3b887db57.zip
Block size
Diffstat (limited to 'ethchain')
-rw-r--r--ethchain/block.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/ethchain/block.go b/ethchain/block.go
index 5765abd51..d2d012e55 100644
--- a/ethchain/block.go
+++ b/ethchain/block.go
@@ -351,7 +351,7 @@ func (block *Block) header() []interface{} {
func (block *Block) String() string {
return fmt.Sprintf(`
- BLOCK(%x):
+ BLOCK(%x): Size: %v
PrevHash: %x
UncleSha: %x
Coinbase: %x
@@ -368,6 +368,7 @@ func (block *Block) String() string {
NumTx: %v
`,
block.Hash(),
+ block.Size(),
block.PrevHash,
block.UncleSha,
block.Coinbase,
@@ -384,3 +385,7 @@ func (block *Block) String() string {
len(block.transactions),
)
}
+
+func (self *Block) Size() ethutil.StorageSize {
+ return ethutil.StorageSize(len(self.RlpEncode()))
+}