What changed, and why it matters
This commit is a routine code organization fix. It adjusts which type names are publicly re-exported (made visible) from the 'block' modules of the library so that the naming convention is consistent across crates. No security issue is present.
No security action needed. Treat as a normal maintenance/API-consistency patch.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch updates public re-exports in rust-bitcoin’s block modules. It adds missing re-exports of BlockMtp and BlockMtpInterval, moves TooBigForRelativeHeightError to a non-inline documentation re-export, and ensures primitives::block mirrors units::block for the relevant types. This is purely an API surface/documentation alignment change with no functional code modifications.
Changed components
bitcoin/src/blockdata/block.rsbitcoin/src/lib.rsprimitives/src/block.rsInspect captured patch +11 / −2
diff --git a/bitcoin/src/blockdata/block.rs b/bitcoin/src/blockdata/block.rs
index 3411a4a0..21f55bcf 100644
--- a/bitcoin/src/blockdata/block.rs
+++ b/bitcoin/src/blockdata/block.rs
@@ -30,8 +30,10 @@ use crate::transaction::{Transaction, TransactionExt as _, Wtxid};
#[rustfmt::skip] // Keep public re-exports separate.
#[doc(inline)]
pub use primitives::block::{Block, Checked, Unchecked, Validation, Version, BlockHash, Header, WitnessCommitment};
+#[doc(no_inline)]
+pub use units::block::TooBigForRelativeHeightError;
#[doc(inline)]
-pub use units::block::{BlockHeight, BlockHeightInterval, TooBigForRelativeHeightError};
+pub use units::block::{BlockHeight, BlockHeightInterval, BlockMtp, BlockMtpInterval};
#[deprecated(since = "TBD", note = "use `BlockHeightInterval` instead")]
#[doc(hidden)]
diff --git a/bitcoin/src/lib.rs b/bitcoin/src/lib.rs
index d9bad2fe..50f07cf6 100644
--- a/bitcoin/src/lib.rs
+++ b/bitcoin/src/lib.rs
@@ -159,7 +159,7 @@ pub use primitives::{
#[doc(inline)]
pub use units::{
amount::{Amount, SignedAmount},
- block::{BlockHeight, BlockHeightInterval, BlockMtp},
+ block::{BlockHeight, BlockHeightInterval, BlockMtp, BlockMtpInterval},
fee_rate::FeeRate,
time::{self, BlockTime},
weight::Weight,
diff --git a/primitives/src/block.rs b/primitives/src/block.rs
index c86abd64..97f07f12 100644
--- a/primitives/src/block.rs
+++ b/primitives/src/block.rs
@@ -25,6 +25,13 @@ use crate::prelude::Vec;
#[cfg(feature = "alloc")]
use crate::transaction::Transaction;
+#[rustfmt::skip] // Keep public re-exports separate.
+#[doc(inline)]
+pub use units::block::{BlockHeight, BlockHeightInterval, BlockMtp, BlockMtpInterval};
+// Re-export errors that appear directly in the API - but no doc inline.
+#[doc(no_inline)]
+pub use units::block::TooBigForRelativeHeightError;
+
/// Marker for whether or not a block has been validated.
///
/// We define valid as:
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.