4305: check all blocks in chain for txid#126
Merged
Merged
Conversation
Contributor
|
🤖 Claude Code Review Status: Complete SummaryThis PR fixes a critical security vulnerability by ensuring duplicate transaction detection works across the entire blockchain history, not just a limited depth window. The change is correct and necessary. Security Context: Changes:
Analysis✅ Implementation is correct:
✅ Test coverage is appropriate:
No issues found - this is a well-designed security fix with proper safeguards already in place. |
freemans13
approved these changes
Nov 6, 2025
icellan
added a commit
that referenced
this pull request
May 19, 2026
go-subtree v1.4.0's NewTxInpoints() returns the zero value (nil
ParentTxHashes). Meta.Serialize rejects nil ParentTxHashes for
non-coinbase nodes, so createValidSubtreeMetadata and the two
inline-init sites in Block_test.go fail with "cannot serialize, parent
tx hashes are not set for node N" when constructing test fixtures.
Pre-v1.4.0 NewTxInpoints returned a cap-8 empty slice, so the same
code path worked. Replace those five sites with an explicit
TxInpoints{ParentTxHashes: []chainhash.Hash{}} literal — semantically
identical and unambiguous about the invariant the test relies on.
The proper fix is upstream — go-subtree PR #126 restores the non-nil
empty ParentTxHashes from NewTxInpoints. Once v1.4.1 lands these
literals can be reverted to NewTxInpoints() calls.
icellan
added a commit
that referenced
this pull request
May 19, 2026
v1.4.1 lands the NewTxInpoints empty-but-non-nil ParentTxHashes fix (go-subtree #126). With that in place the interim Block_test.go workaround reverted in the previous commit is no longer needed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.