Skip to content

Commit

Permalink
fix WithSidecars (#2327)
Browse files Browse the repository at this point in the history
  • Loading branch information
buddh0 authored Mar 22, 2024
1 parent 96605e4 commit 0800afd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
6 changes: 1 addition & 5 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -1404,11 +1404,7 @@ func (bc *BlockChain) InsertReceiptChain(blockChain types.Blocks, receiptChain [

// Write all chain data to ancients.
td := bc.GetTd(first.Hash(), first.NumberU64())
var (
writeSize int64
err error
)
writeSize, err = rawdb.WriteAncientBlocks(bc.db, blockChain, receiptChain, td)
writeSize, err := rawdb.WriteAncientBlocks(bc.db, blockChain, receiptChain, td)

if err != nil {
log.Error("Error importing chain data to ancients", "err", err)
Expand Down
4 changes: 1 addition & 3 deletions core/rawdb/freezer_batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ type freezerBatch struct {
}

func newFreezerBatch(f *Freezer) *freezerBatch {
batch := &freezerBatch{
tables: make(map[string]*freezerTableBatch, len(f.tables)),
}
batch := &freezerBatch{tables: make(map[string]*freezerTableBatch, len(f.tables))}
for kind, table := range f.tables {
batch.tables[kind] = table.newBatch(f.offset)
}
Expand Down
6 changes: 3 additions & 3 deletions core/types/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -544,10 +544,10 @@ func (b *Block) WithSidecars(sidecars BlobSidecars) *Block {
transactions: b.transactions,
uncles: b.uncles,
withdrawals: b.withdrawals,
sidecars: sidecars,
}
if b.withdrawals != nil {
block.withdrawals = b.withdrawals
if b.sidecars != nil {
block.sidecars = make(BlobSidecars, len(sidecars))
copy(block.sidecars, sidecars)
}
return block
}
Expand Down

0 comments on commit 0800afd

Please sign in to comment.