Skip to content

Commit

Permalink
bugfix: Don't add a block to append queue if its already appended
Browse files Browse the repository at this point in the history
  • Loading branch information
gameofpointers committed Apr 6, 2023
1 parent 8c55c66 commit 6002b76
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,14 @@ func (c *Core) Stop() {

// WriteBlock write the block to the bodydb database
func (c *Core) WriteBlock(block *types.Block) {
isDomCoincident := c.sl.engine.IsDomCoincident(block.Header())
// Only add non dom blocks to the append queue
if !isDomCoincident {
c.addToAppendQueue(block)
if c.GetBlockByHash(block.Hash()) == nil {
isDomCoincident := c.sl.engine.IsDomCoincident(block.Header())
// Only add non dom blocks to the append queue
if !isDomCoincident {
c.addToAppendQueue(block)
}
c.sl.WriteBlock(block)
}
c.sl.WriteBlock(block)
}

func (c *Core) Append(header *types.Header, domPendingHeader *types.Header, domTerminus common.Hash, td *big.Int, domOrigin bool, reorg bool, newInboundEtxs types.Transactions) ([]types.Transactions, error) {
Expand Down

0 comments on commit 6002b76

Please sign in to comment.