Skip to content

Commit 7aefe12

Browse files
committed
core/types: add Transaction.Size
1 parent fda49f2 commit 7aefe12

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

core/types/transaction.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ func (tx *Transaction) Hash() common.Hash {
6767
})
6868
}
6969

70+
// Size returns the encoded RLP size of tx.
71+
func (self *Transaction) Size() common.StorageSize {
72+
c := writeCounter(0)
73+
rlp.Encode(&c, self)
74+
return common.StorageSize(c)
75+
}
76+
7077
func (self *Transaction) Data() []byte {
7178
return self.Payload
7279
}

0 commit comments

Comments
 (0)