Block size

This commit is contained in:
obscuren
2014-08-25 12:53:06 +02:00
parent 3f904bf3ac
commit 6afc16399f
4 changed files with 35 additions and 2 deletions

View File

@@ -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()))
}