Fix grammar in MerkleBlock error messages
What changed, and why it matters
This commit only fixes spelling and grammar in human-readable error messages and a doc comment. It changes 'And I/O error' to 'An I/O error', 'less bits' to 'fewer bits', and 'not all bit were consumed' to 'not all bits were consumed'. There is no code behavior change and no security relevance.
No security action needed. Treat as a normal non-functional cleanup commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies three string literals/doc comments across bitcoin/src/consensus/error.rs and bitcoin/src/merkle_tree/block.rs. No logic, control flow, parsing, serialization, or cryptographic code is altered. The changes are purely cosmetic improvements to user-facing error text.
Changed components
bitcoin/src/consensus/error.rsbitcoin/src/merkle_tree/block.rsInspect captured patch +3 / −3
diff --git a/bitcoin/src/consensus/error.rs b/bitcoin/src/consensus/error.rs
index 86a9f7cd..00c86936 100644
--- a/bitcoin/src/consensus/error.rs
+++ b/bitcoin/src/consensus/error.rs
@@ -99,7 +99,7 @@ impl<E: fmt::Debug + std::error::Error + 'static> std::error::Error for DecodeEr
#[derive(Debug)]
#[non_exhaustive]
pub enum Error {
- /// And I/O error.
+ /// An I/O error.
Io(io::Error),
/// Error parsing encoded object.
Parse(ParseError),
diff --git a/bitcoin/src/merkle_tree/block.rs b/bitcoin/src/merkle_tree/block.rs
index 580923c3..837044b7 100644
--- a/bitcoin/src/merkle_tree/block.rs
+++ b/bitcoin/src/merkle_tree/block.rs
@@ -489,8 +489,8 @@ impl fmt::Display for MerkleBlockError {
NoTransactions => write!(f, "partial Merkle tree contains no transactions"),
TooManyTransactions => write!(f, "too many transactions"),
TooManyHashes => write!(f, "proof contains more hashes than transactions"),
- NotEnoughBits => write!(f, "proof contains less bits than hashes"),
- NotAllBitsConsumed => write!(f, "not all bit were consumed"),
+ NotEnoughBits => write!(f, "proof contains fewer bits than hashes"),
+ NotAllBitsConsumed => write!(f, "not all bits were consumed"),
NotAllHashesConsumed => write!(f, "not all hashes were consumed"),
BitsArrayOverflow => write!(f, "overflowed the bits array"),
HashesArrayOverflow => write!(f, "overflowed the hashes array"),
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.