Skip to content

Fix couple of minor bugs#78

Open
RCasatta wants to merge 5 commits into
masterfrom
develop
Open

Fix couple of minor bugs#78
RCasatta wants to merge 5 commits into
masterfrom
develop

Conversation

@RCasatta
Copy link
Copy Markdown
Owner

No description provided.

RCasatta and others added 5 commits May 18, 2026 11:56
After store.reorg() the blocks_hash_ts vector is not truncated,
so tip_height/tip_hash/block_hash still expose the reorged block.
The test asserts the current (wrong) behaviour with a TODO marking
what the correct assertions should be.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
During a reorg, store.reorg() rolled back the persistent state but
blocks_hash_ts was not truncated. This left a window where
tip_hash / block_hash still returned the reorged block's data.

Extract State::handle_reorg() that atomically truncates
blocks_hash_ts and calls store.reorg(), and use it from the
block-indexing thread.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The retain loop over outpoints_created called txids.contains() for each
entry, making it O(n*m) where n is outpoints and m is removed txids.
Collecting txids into a HashSet first reduces this to O(n+m).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant