Skip to content

Commit

Permalink
Import eth/handler.go from [email protected] (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
ironbeer authored Nov 6, 2024
1 parent 4a3a723 commit c4d4b3a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion eth/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,18 @@ func newHandler(config *handlerConfig) (*handler, error) {
}
return h.chain.InsertChain(blocks)
}
h.blockFetcher = fetcher.NewBlockFetcher(false, nil, h.chain.GetBlockByHash, validator, h.BroadcastBlock,

broadcastBlockWithCheck := func(block *types.Block, propagate bool) {
if propagate {
if err := core.IsDataAvailable(h.chain, block); err != nil {
log.Error("Propagating block with invalid sidecars", "number", block.Number(), "hash", block.Hash(), "err", err)
return
}
}
h.BroadcastBlock(block, propagate)
}

h.blockFetcher = fetcher.NewBlockFetcher(false, nil, h.chain.GetBlockByHash, validator, broadcastBlockWithCheck,
heighter, finalizeHeighter, nil, inserter, h.removePeer)

fetchTx := func(peer string, hashes []common.Hash) error {
Expand Down

0 comments on commit c4d4b3a

Please sign in to comment.