Skip to content

Commit

Permalink
Premerge paritytech#10498 (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshOrndorff authored Dec 16, 2021
1 parent 24a1737 commit 3a5aa8c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion client/consensus/manual-seal/src/seal_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,14 @@ pub async fn seal_block<B, BI, SC, C, E, TP, CIDP>(
digest_provider.append_block_import(&parent, &mut params, &inherent_data)?;
}

// Make sure we return the same post-hash that will be calculated when importing the block
// This is important in case the digest_provider added any signature, seal, ect.
let mut post_header = header.clone();
post_header.digest_mut().logs.extend(params.post_digests.iter().cloned());

match block_import.import_block(params, HashMap::new()).await? {
ImportResult::Imported(aux) =>
Ok(CreatedBlock { hash: <B as BlockT>::Header::hash(&header), aux }),
Ok(CreatedBlock { hash: <B as BlockT>::Header::hash(&post_header), aux }),
other => Err(other.into()),
}
};
Expand Down

0 comments on commit 3a5aa8c

Please sign in to comment.