[#CoinsViewCacheCursor-2constructor]
= xref:CoinsViewCacheCursor.adoc[CoinsViewCacheCursor]::CoinsViewCacheCursor
:relfileprefix: ../
:mrdocs:

If will&lowbar;erase is not set, iterating through the cursor will erase spent coins from the map, and other coins will be unflagged (removing them from the linked list)&period; If will&lowbar;erase is set, the underlying map and linked list will not be modified, as the caller is expected to wipe the entire map anyway&period; This is an optimization compared to erasing all entries as the cursor iterates them when will&lowbar;erase is set&period; Calling CCoinsMap&colon;&colon;clear() afterwards is faster because a CoinsCachePair cannot be coerced back into a CCoinsMap&colon;&colon;iterator to be erased, and must therefore be looked up again by key in the CCoinsMap before being erased&period;

== Synopsis

Declared in `&lt;coins&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
CoinsViewCacheCursor(
    size&lowbar;t& dirty&lowbar;count,
    xref:CoinsCachePair.adoc[CoinsCachePair]& sentinel,
    xref:CCoinsMap.adoc[CCoinsMap]& map,
    bool will&lowbar;erase) noexcept;
----

== Parameters

[cols="1,4"]
|===
| Name| Description
| *dirty&lowbar;count*
| Running count of dirty entries, decremented as entries are consumed&period;
| *sentinel*
| Sentinel node of the flagged&hyphen;entry linked list to iterate&period;
| *map*
| The coins map whose entries may be erased or unflagged&period;
| *will&lowbar;erase*
| When true, leave the map untouched because the caller will wipe it wholesale&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
