Commit 7aefe123 authored by Felix Lange's avatar Felix Lange

core/types: add Transaction.Size

parent fda49f2b
......@@ -67,6 +67,13 @@ func (tx *Transaction) Hash() common.Hash {
})
}
// Size returns the encoded RLP size of tx.
func (self *Transaction) Size() common.StorageSize {
c := writeCounter(0)
rlp.Encode(&c, self)
return common.StorageSize(c)
}
func (self *Transaction) Data() []byte {
return self.Payload
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment