What changed, and why it matters
This is a trivial code cleanup change. It replaces one way of referring to a type (`crate::Wtxid`) with a direct import (`Wtxid`). The program's behavior is unchanged, and there is no security relevance.
No action required. This change can be treated as routine maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies primitives/src/block.rs to import Wtxid directly alongside Transaction under the alloc feature gate, then updates the single usage inside compute_witness_root from crate::Wtxid::COINBASE to Wtxid::COINBASE. This is a pure refactoring with no functional or API change.
Changed components
primitives/src/block.rsInspect captured patch +3 / −3
diff --git a/primitives/src/block.rs b/primitives/src/block.rs
index d3a3eee4..000ee017 100644
--- a/primitives/src/block.rs
+++ b/primitives/src/block.rs
@@ -29,9 +29,9 @@ use crate::pow::{CompactTargetDecoder, CompactTargetDecoderError};
#[cfg(feature = "alloc")]
use crate::prelude::Vec;
use crate::time::{BlockTimeDecoder, BlockTimeDecoderError};
-#[cfg(feature = "alloc")]
-use crate::Transaction;
use crate::{BlockTime, CompactTarget};
+#[cfg(feature = "alloc")]
+use crate::{Transaction, Wtxid};
#[rustfmt::skip] // Keep public re-exports separate.
#[doc(inline)]
@@ -504,7 +504,7 @@ pub fn compute_witness_root(transactions: &[Transaction]) -> Option<WitnessMerkl
let hashes = transactions.iter().enumerate().map(|(i, t)| {
if i == 0 {
// Replace the first hash with zeroes.
- crate::Wtxid::COINBASE
+ Wtxid::COINBASE
} else {
t.compute_wtxid()
}
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.