A Coin in one level of the coins database caching hierarchy.
Declared in <coins.h>
struct CCoinsCacheEntry;
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)
| Name | Description |
|---|---|
Flags | Per-entry state flags controlling how an entry is flushed to the parent cache. |
| Name | Description |
|---|---|
CCoinsCacheEntry [constructor] | Constructors |
~CCoinsCacheEntry [destructor] | Remove the entry from the flagged linked list before it is destroyed. |
IsDirty | Report whether the entry is marked DIRTY. |
IsFresh | Report whether the entry is marked FRESH. |
Next | Only call Next when this entry is DIRTY, FRESH, or both |
Prev | Only call Prev when this entry is DIRTY, FRESH, or both |
SelfRef | Only use this for initializing the linked list sentinel |
SetClean | Clear all flags and unlink the entry from the flagged linked list. |
| Name | Description |
|---|---|
SetDirty | Mark an entry DIRTY, adding it to the flagged linked list if needed. |
SetFresh | Mark an entry FRESH, adding it to the flagged linked list if needed. |
| Name | Description |
|---|---|
coin | The actual cached coin data. |