fn process_blobs(blobs: &[SharedBlob], blocktree: &Arc<Blocktree>) -> Result<()> {
    // make an iterator for insert_data_blobs()
    let blobs: Vec<_> = blobs.iter().map(move |blob| blob.read().unwrap()).collect();

    blocktree.insert_data_blobs(blobs.iter().filter_map(|blob| {
        if !blob.is_coding() {
            Some(&(**blob))
        } else {
            None
        }
    }))?;

    for blob in blobs {
        // TODO: Once the original leader signature is added to the blob, make sure that
        // the blob was originally generated by the expected leader for this slot

        // Insert the new blob into block tree
        if blob.is_coding() {
            blocktree.put_coding_blob_bytes(
                blob.slot(),
                blob.index(),
                &blob.data[..BLOB_HEADER_SIZE + blob.size()],
            )?;
        }
    }
    Ok(())
}
/// Process a blob: Add blob to the ledger window.
Process a blob: Add blob to the ledger window.
Process a blob : Add blob to the ledger window .
fn process_blobs(blobs: &[SharedBlob], blocktree: &Arc<Blocktree>) -> Result<()> {
    // make an iterator for insert_data_blobs()
    let blobs: Vec<_> = blobs.iter().map(move |blob| blob.read().unwrap()).collect();
    blocktree.insert_data_blobs(blobs.iter().filter_map(|blob| {
        if !blob.is_coding() {
            Some(&(**blob))
        } else {
            None
        }
    }))?;
    for blob in blobs {
        // TODO: Once the original leader signature is added to the blob, make sure that
        // the blob was originally generated by the expected leader for this slot
        // Insert the new blob into block tree
        if blob.is_coding() {
            blocktree.put_coding_blob_bytes(
                blob.slot(),
                blob.index(),
                &blob.data[..BLOB_HEADER_SIZE + blob.size()],
            )?;
        }
    }
    Ok(())
}
fn process_blobs ( blobs : & [ SharedBlob ] , blocktree : & Arc < Blocktree > ) -> Result < ( ) > { // make an iterator for insert_data_blobs() let blobs : Vec < _ > = blobs . iter ( ) . map ( move | blob | blob . read ( ) . unwrap ( ) ) . collect ( ) ; blocktree . insert_data_blobs ( blobs . iter ( ) . filter_map ( | blob | { if ! blob . is_coding ( ) { Some ( & ( * * blob ) ) } else { None } } ) ) ? ; for blob in blobs { // TODO: Once the original leader signature is added to the blob, make sure that // the blob was originally generated by the expected leader for this slot // Insert the new blob into block tree if blob . is_coding ( ) { blocktree . put_coding_blob_bytes ( blob . slot ( ) , blob . index ( ) , & blob . data [ .. BLOB_HEADER_SIZE + blob . size ( ) ] , ) ? ; } } Ok ( ( ) ) }
Process a blob: Add blob to the ledger window.
Process a blob : Add blob to the ledger window .
blobs
&[SharedBlob]
blocktree
&Arc<Blocktree>
blobs
&[SharedBlob]
blocktree
&Arc<Blocktree>