Skip to content

Commit

Permalink
Merge branch 'secp256r1-precompile' of github.com:OffchainLabs/go-eth…
Browse files Browse the repository at this point in the history
…ereum into secp256r1-precompile
  • Loading branch information
anodar committed Apr 17, 2024
2 parents 35b8b1f + 1cc2bff commit da33df1
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions core/blockchain_arbitrum.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package core

import (
"errors"
"fmt"
"time"

"github.com/ethereum/go-ethereum/core/state"
Expand All @@ -40,21 +40,9 @@ func (bc *BlockChain) WriteBlockAndSetHeadWithTime(block *types.Block, receipts
func (bc *BlockChain) ReorgToOldBlock(newHead *types.Block) error {
bc.wg.Add(1)
defer bc.wg.Done()
locked := bc.chainmu.TryLock()
if !locked {
return errors.New("couldn't catch lock to reorg")
if _, err := bc.SetCanonical(newHead); err != nil {
return fmt.Errorf("error reorging to old block: %w", err)
}
defer bc.chainmu.Unlock()
oldHead := bc.CurrentBlock()
if oldHead.Hash() == newHead.Hash() {
return nil
}
bc.writeHeadBlock(newHead)
err := bc.reorg(oldHead, newHead)
if err != nil {
return err
}
bc.chainHeadFeed.Send(ChainHeadEvent{Block: newHead})
return nil
}

Expand Down

0 comments on commit da33df1

Please sign in to comment.