What changed, and why it matters
This commit only fixes two mistakes in code comments. One comment incorrectly named a previously called function, and another comment had a wrong arithmetic result for the maximum time value. No actual code behavior changes, so there is no security impact.
No security action needed; this is a non-functional comment cleanup. Optionally review surrounding code for any related logic errors, but none are present in the diff.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch is purely documentation/comment-only. In units/src/amount/unsigned.rs, an unreachable-arm comment is corrected from ‘checked_div’ to ‘checked_rem’. In units/src/locktime/relative/mod.rs, the doc comment for NumberOf512Seconds::MAX is corrected from 33,554,432 to 33,553,920 seconds (u16::MAX * 512 = 65,535 * 512 = 33,553,920). The constants and logic remain unchanged.
Changed components
units/src/amount/unsigned.rsunits/src/locktime/relative/mod.rsInspect captured patch +2 / −2
diff --git a/units/src/amount/unsigned.rs b/units/src/amount/unsigned.rs
index 7c96ce56..465c305f 100644
--- a/units/src/amount/unsigned.rs
+++ b/units/src/amount/unsigned.rs
@@ -397,7 +397,7 @@ impl Amount {
match self.to_sat().checked_rem(rhs) {
Some(res) => match Self::from_sat(res) {
Ok(amount) => Some(amount),
- Err(_) => None, // Unreachable because of checked_div above.
+ Err(_) => None, // Unreachable because of checked_rem above.
},
None => None,
}
diff --git a/units/src/locktime/relative/mod.rs b/units/src/locktime/relative/mod.rs
index 26a02d84..9d5a1c34 100644
--- a/units/src/locktime/relative/mod.rs
+++ b/units/src/locktime/relative/mod.rs
@@ -482,7 +482,7 @@ impl NumberOf512Seconds {
/// The minimum relative block time (0), can be included in any block.
pub const MIN: Self = Self::ZERO;
- /// The maximum relative block time (33,554,432 seconds or approx 388 days).
+ /// The maximum relative block time (33,553,920 seconds or approx 388 days).
pub const MAX: Self = Self(u16::MAX);
/// Constructs a new [`NumberOf512Seconds`] using time intervals where each interval is
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.