I tripped over this one for a few hours at the beginning of the week, so I’ve sort of got a personal vendetta against CCoinsView::Cursor()
returning a raw pointer.
Specifically in the case of CCoinsViewDB, if a raw cursor is allocated and not freed, a cryptic leveldb assertion failure occurs on CCoinsViewDB destruction (Assertion 'dummy_versions_.next_ == &dummy_versions_' failed.
).
This is a pretty simple change.
Related to: #21766 See also: https://github.com/google/leveldb/issues/142#issuecomment-414418135