Exit early if blob by root request is empty (#13038)

This commit is contained in:
terencechain
2023-10-11 19:27:26 -07:00
committed by GitHub
parent 99843688cd
commit 867db1aeee

View File

@@ -145,6 +145,10 @@ func (s *Service) requestPendingBlobs(ctx context.Context, block interfaces.Read
// sendAndSaveBlobSidecars sends the blob request and saves received sidecars.
func (s *Service) sendAndSaveBlobSidecars(ctx context.Context, request types.BlobSidecarsByRootReq, contextByte ContextByteVersions, peerID peer.ID) error {
if len(request) == 0 {
return nil
}
sidecars, err := SendBlobSidecarByRoot(ctx, s.cfg.clock, s.cfg.p2p, peerID, contextByte, &request)
if err != nil {
return err