Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2335 +/- ##
==========================================
+ Coverage 78.84% 78.87% +0.02%
==========================================
Files 31 31
Lines 6060 6063 +3
Branches 288 289 +1
==========================================
+ Hits 4778 4782 +4
+ Misses 1203 1202 -1
Partials 79 79
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
evanlinjin
reviewed
Oct 1, 2026
evanlinjin
left a comment
Member
There was a problem hiding this comment.
Thank you for the PR. Looks good. Just some suggestions for doc comments before ACK.
Member
|
A final request - could you please squash the commits into one? Thanks |
Reject an occupied index before changing either lookup map. Preserve existing script, scanned-output and used-status mappings on a rejected insertion, matching the existing behavior for an occupied script.
h55n
force-pushed
the
fix-spk-txout-occupied-index
branch
from
October 2, 2026 00:18
599b5fd to
da0dc65
Compare
Author
|
Thanks, squashed into one commit and applied the doc suggestion. |
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.
Description
Fixes #2279.
SpkTxOutIndex::insert_spk currently accepts a different script at an existing index. The forward lookup is overwritten while the old reverse lookup remains, so the two maps disagree.
This returns false without changing state when the index is already occupied, matching the existing behavior for an occupied script. The method documentation now covers both cases.
Notes to the reviewers
Added regressions for both lookup directions, unused scripts and previously scanned outputs. A rejected insertion preserves the old output and used status, and the rejected script is not tracked.
Testing on the refreshed master base:
Changelog notice
Reject duplicate indices in SpkTxOutIndex::insert_spk without changing existing script or output state.