doc: remove stale shortid collision TODO
What changed, and why it matters
This commit only removes a two-line comment (a TODO note) from the source code. No actual code behavior changes. The TODO had suggested a future improvement for handling rare compact-block short-ID collisions, but the developers decided the current behavior—failing early on collisions—is intentional and preferable. It is purely a documentation cleanup.
No action required. This is a non-functional documentation cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff deletes a TODO comment in src/blockencodings.cpp within PartiallyDownloadedBlock::InitData(). The existing logic already returns READ_STATUS_FAILED when a shorttxids bucket exceeds size 12 or when shorttxids.size() differs from cmpctblock.shorttxids.size(), indicating a short-ID collision. The commit message states this early-failure behavior is intentional for honest peers because collisions are rare, and the old TODO’s suggestion to request both collided transactions points at unwanted behavior. No functional code was modified.
Changed components
src/blockencodings.cppInspect captured patch +0 / −2
diff --git a/src/blockencodings.cpp b/src/blockencodings.cpp
index fd528309..18799cd8 100644
--- a/src/blockencodings.cpp
+++ b/src/blockencodings.cpp
@@ -110,8 +110,6 @@ ReadStatus PartiallyDownloadedBlock::InitData(const CBlockHeaderAndShortTxIDs& c
if (shorttxids.bucket_size(shorttxids.bucket(cmpctblock.shorttxids[i])) > 12)
return READ_STATUS_FAILED;
}
- // TODO: in the shortid-collision case, we should instead request both transactions
- // which collided. Falling back to full-block-request here is overkill.
if (shorttxids.size() != cmpctblock.shorttxids.size())
return READ_STATUS_FAILED; // Short ID collision
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.