I need this for something else, but I think this is simply a better API. I also vaguely remember this has been discussed before.
- Add a method
Cursor()
toCCoinsView
that returns a cursor which can be used to iterate over the whole UTXO set. - Implement
GetUTXOStats
in terms of this, removeGetStats()
method onCCoinsView
. - Change gettxoutsetinfo RPC to use new
GetUTXOStats
function.
This is not yet enough to break the dependency of txdb.cpp/h on main (there’s CDiskTxPos to cope with, for example), but it is a step toward that (see #7815).