eth/downloader: ignore zero size header batch for importing (#24569)
* eth/downloader: ignore zero size header batch for importing * core, light: reject empty header batch for importing
This commit is contained in:
@ -419,6 +419,9 @@ func (lc *LightChain) SetChainHead(header *types.Header) error {
|
||||
// In the case of a light chain, InsertHeaderChain also creates and posts light
|
||||
// chain events when necessary.
|
||||
func (lc *LightChain) InsertHeaderChain(chain []*types.Header, checkFreq int) (int, error) {
|
||||
if len(chain) == 0 {
|
||||
return 0, nil
|
||||
}
|
||||
if atomic.LoadInt32(&lc.disableCheckFreq) == 1 {
|
||||
checkFreq = 0
|
||||
}
|
||||
|
Reference in New Issue
Block a user