Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
liuchengxu committed Jul 25, 2024
1 parent 45f3ff3 commit 0a70b08
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion crates/sc-consensus-nakamoto/src/verification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ mod tests {
.get(&index)
.copied()
.unwrap())
.map(|(txout, _is_coinbase)| txout.value.to_sat())
.map(|(txout, is_coinbase)| (txout.value.to_sat(), is_coinbase))
.unwrap(),
(295600000, false)
);
Expand Down
13 changes: 7 additions & 6 deletions crates/sc-consensus-nakamoto/src/verification/header_verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,14 @@ where
Block: BlockT,
Client: HeaderBackend<Block> + AuxStore,
{
/// Verifies the validity of header and returns the block time for verifying the finality of
/// transactions.
/// Validates the header and returns the block time, which is used for verifying the finality of
/// transactions in [`super::tx_verify::is_final`].
///
/// - Check proof of work.
/// - Check the timestamp of block.
/// - Time is not greater than 2 hours from now.
/// - Time is not the median time of last 11 blocks or before.
/// The validation process includes:
/// - Checking the proof of work.
/// - Validating the block's timestamp:
/// - The time must not be more than 2 hours in the future.
/// - The time must be greater than the median time of the last 11 blocks.
///
/// <https://github.com/bitcoin/bitcoin/blob/6f9db1ebcab4064065ccd787161bf2b87e03cc1f/src/validation.cpp#L4146>
pub fn verify_header(&self, header: &BitcoinHeader) -> Result<u32, Error> {
Expand Down

0 comments on commit 0a70b08

Please sign in to comment.