Skip to content

Commit 4d86eda

Browse files
fix(docs): align BlockValidationResult doc comments with C API
Several doc comments were inaccurate or vaguer than the upstream definitions. Importantly, Consensus was documented as "Block is valid according to consensus rules" when it actually means the opposite - a consensus rule violation. Align all affected variants with the upstream comments for accuracy.
1 parent 52090ec commit 4d86eda

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/notifications/types.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,23 +141,23 @@ impl From<btck_ValidationMode> for ValidationMode {
141141
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
142142
#[repr(u32)]
143143
pub enum BlockValidationResult {
144-
/// Initial value - block has not yet been validated
144+
/// Initial value - block has not yet been rejected
145145
Unset = btck_BlockValidationResult_UNSET,
146-
/// Block is valid according to consensus rules
146+
/// Invalid by consensus rules (excluding any reason listed below)
147147
Consensus = btck_BlockValidationResult_CONSENSUS,
148148
/// Block was cached as invalid (reason not stored)
149149
CachedInvalid = btck_BlockValidationResult_CACHED_INVALID,
150-
/// Block header is invalid (proof of work or timestamp)
150+
/// Block header has invalid proof of work or timestamp is too old
151151
InvalidHeader = btck_BlockValidationResult_INVALID_HEADER,
152152
/// Block data doesn't match the proof of work commitment
153153
Mutated = btck_BlockValidationResult_MUTATED,
154154
/// Previous block is not available
155155
MissingPrev = btck_BlockValidationResult_MISSING_PREV,
156-
/// Previous block is invalid
156+
/// A block this one builds on is invalid
157157
InvalidPrev = btck_BlockValidationResult_INVALID_PREV,
158-
/// Block timestamp is too far in the future
158+
/// Block timestamp was more than 2 hours in the future (or our clock is bad)
159159
TimeFuture = btck_BlockValidationResult_TIME_FUTURE,
160-
/// Block header indicates insufficient work
160+
/// The block header may be on a too-little-work chain
161161
HeaderLowWork = btck_BlockValidationResult_HEADER_LOW_WORK,
162162
}
163163

0 commit comments

Comments
 (0)