Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core/types: remove unused field 'td' in Block #25010

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Remove unused td field in Block type
  • Loading branch information
zimbabao committed Jun 2, 2022
commit ac14d69cd5795dbf95929714df1391890c46c04e
6 changes: 1 addition & 5 deletions core/types/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,6 @@ type Block struct {
hash atomic.Value
size atomic.Value

// Td is used by package core to store the total difficulty
// of the chain up to and including the block.
td *big.Int

// These fields are used by package eth to track
// inter-peer block relay.
ReceivedAt time.Time
Expand All @@ -197,7 +193,7 @@ type extblock struct {
// are ignored and set to values derived from the given txs, uncles
// and receipts.
func NewBlock(header *Header, txs []*Transaction, uncles []*Header, receipts []*Receipt, hasher TrieHasher) *Block {
b := &Block{header: CopyHeader(header), td: new(big.Int)}
b := &Block{header: CopyHeader(header)}

// TODO: panic if len(txs) != len(receipts)
if len(txs) == 0 {
Expand Down