Skip to content

Singly linked coins cache#164

Draft
l0rinc wants to merge 2 commits into
masterfrom
l0rinc/singly-linked-coins-cache
Draft

Singly linked coins cache#164
l0rinc wants to merge 2 commits into
masterfrom
l0rinc/singly-linked-coins-cache

Conversation

@l0rinc

@l0rinc l0rinc commented May 8, 2026

Copy link
Copy Markdown
Owner

No description provided.

l0rinc added 2 commits May 8, 2026 11:08
Spent FRESH entries do not need to be written to the parent cache, but erasing them immediately requires arbitrary linked-list deletion from the cache entry.

Keep those entries as spent FRESH tombstones, count them, and compact them by scanning only the flagged-entry list when memory pressure is about to trigger a cache write.
Spent FRESH entries are now retained as tombstones until compaction, so normal spend paths no longer need arbitrary linked-list deletion.

Drop the back pointer from `CCoinsCacheEntry` and update list cleanup to use the predecessor already known by cursor and compaction iteration. This reduces the cache entry size by one pointer while preserving direct iteration over flagged entries.
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