diff options
author | Felix Lange <fjl@twurst.com> | 2015-06-09 17:58:41 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2015-06-09 23:06:31 +0800 |
commit | 7aefe123e98240ad4df440a8d1be4446744c8ca2 (patch) | |
tree | d39562e75a85ae7b98977b73f6cdad0e37f494db /core/types | |
parent | fda49f2b5216c7d5655d19efe54651593874adf8 (diff) | |
download | go-tangerine-7aefe123e98240ad4df440a8d1be4446744c8ca2.tar go-tangerine-7aefe123e98240ad4df440a8d1be4446744c8ca2.tar.gz go-tangerine-7aefe123e98240ad4df440a8d1be4446744c8ca2.tar.bz2 go-tangerine-7aefe123e98240ad4df440a8d1be4446744c8ca2.tar.lz go-tangerine-7aefe123e98240ad4df440a8d1be4446744c8ca2.tar.xz go-tangerine-7aefe123e98240ad4df440a8d1be4446744c8ca2.tar.zst go-tangerine-7aefe123e98240ad4df440a8d1be4446744c8ca2.zip |
core/types: add Transaction.Size
Diffstat (limited to 'core/types')
-rw-r--r-- | core/types/transaction.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/types/transaction.go b/core/types/transaction.go index 3d6d31ae7..a03a6b847 100644 --- a/core/types/transaction.go +++ b/core/types/transaction.go @@ -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 } |