[#CCoinsCacheEntry] = CCoinsCacheEntry :mrdocs: A Coin in one level of the coins database caching hierarchy. == Synopsis Declared in `<coins.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- 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 [cols="1,4"] |=== | Name| Description | xref:CCoinsCacheEntry/Flags.adoc[`Flags`] | Per‐entry state flags controlling how an entry is flushed to the parent cache. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:CCoinsCacheEntry/2constructor-00.adoc[`CCoinsCacheEntry`] [.small]#[constructor]# | Constructors | xref:CCoinsCacheEntry/2destructor.adoc[`~CCoinsCacheEntry`] [.small]#[destructor]# | Remove the entry from the flagged linked list before it is destroyed. | xref:CCoinsCacheEntry/IsDirty.adoc[`IsDirty`] | Report whether the entry is marked DIRTY. | xref:CCoinsCacheEntry/IsFresh.adoc[`IsFresh`] | Report whether the entry is marked FRESH. | xref:CCoinsCacheEntry/Next.adoc[`Next`] | Only call Next when this entry is DIRTY, FRESH, or both | xref:CCoinsCacheEntry/Prev.adoc[`Prev`] | Only call Prev when this entry is DIRTY, FRESH, or both | xref:CCoinsCacheEntry/SelfRef.adoc[`SelfRef`] | Only use this for initializing the linked list sentinel | xref:CCoinsCacheEntry/SetClean.adoc[`SetClean`] | Clear all flags and unlink the entry from the flagged linked list. |=== == Static Member Functions [cols="1,4"] |=== | Name| Description | xref:CCoinsCacheEntry/SetDirty.adoc[`SetDirty`] | Mark an entry DIRTY, adding it to the flagged linked list if needed. | xref:CCoinsCacheEntry/SetFresh.adoc[`SetFresh`] | Mark an entry FRESH, adding it to the flagged linked list if needed. |=== == Data Members [cols="1,4"] |=== | Name| Description | xref:CCoinsCacheEntry/coin.adoc[`coin`] | The actual cached coin data. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#