A Coin in one level of the coins database caching hierarchy.
Synopsis
Declared in <coins.h>
struct CCoinsCacheEntry;
Description
A coin can either be:
-
unspent or spent (in which case the Coin object will be nulled out ‐ see Coin.Clear())
-
DIRTY or not DIRTY
-
FRESH or not FRESH
Out of these 2ˆ3 = 8 states, only some combinations are valid:
-
unspent, FRESH, DIRTY (e.g. a new coin created in the cache)
-
unspent, not FRESH, DIRTY (e.g. a coin changed in the cache during a reorg)
-
unspent, not FRESH, not DIRTY (e.g. an unspent coin fetched from the parent cache)
-
spent, not FRESH, DIRTY (e.g. a coin is spent and spentness needs to be flushed to the parent)
Enums
Name |
Description |
Per‐entry state flags controlling how an entry is flushed to the parent cache. |
Member Functions
Name |
Description |
|
Constructors |
|
Remove the entry from the flagged linked list before it is destroyed. |
Report whether the entry is marked DIRTY. |
|
Report whether the entry is marked FRESH. |
|
Only call Next when this entry is DIRTY, FRESH, or both |
|
Only call Prev when this entry is DIRTY, FRESH, or both |
|
Only use this for initializing the linked list sentinel |
|
Clear all flags and unlink the entry from the flagged linked list. |