Don't send empty blobs sidecar for blobs by range request

This commit is contained in:
Emilia Hane 2023-01-05 10:30:10 +01:00
parent 01ac7ad23c
commit 597363d2f9
No known key found for this signature in database
GPG Key ID: E73394F9C09206FA

View File

@ -660,10 +660,15 @@ impl<T: BeaconChainTypes> Worker<T> {
for root in block_roots {
match self.chain.store.get_blobs(&root) {
Ok(Some(blob)) => {
let response_data = if blob.blobs.len() > 0 {
Some(Arc::new(blob))
} else {
None
};
blobs_sent += 1;
self.send_network_message(NetworkMessage::SendResponse {
peer_id,
response: Response::BlobsByRange(Some(Arc::new(blob))),
response: Response::BlobsByRange(response_data),
id: request_id,
});
}