We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4fa8ee6 commit 36636b3Copy full SHA for 36636b3
core/types/block.go
@@ -117,7 +117,11 @@ var headerSize = common.StorageSize(reflect.TypeOf(Header{}).Size())
117
// Size returns the approximate memory used by all internal contents. It is used
118
// to approximate and limit the memory consumption of various caches.
119
func (h *Header) Size() common.StorageSize {
120
- return headerSize + common.StorageSize(len(h.Extra)+(h.Difficulty.BitLen()+h.Number.BitLen())/8)
+ var baseFeeBits int
121
+ if h.BaseFee != nil {
122
+ baseFeeBits = h.BaseFee.BitLen()
123
+ }
124
+ return headerSize + common.StorageSize(len(h.Extra)+(h.Difficulty.BitLen()+h.Number.BitLen()+baseFeeBits)/8)
125
}
126
127
// SanityCheck checks a few basic things -- these checks are way beyond what
0 commit comments