mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-21 21:20:07 +01:00
7ad414f4bfdoc: add comment about CCoinsViewDBCursor constructor (James O'Beirne)0f8a5a4dd5move-only(ish): don't expose CCoinsViewDBCursor (James O'Beirne)615c1adfb0refactor: wrap CCoinsViewCursor in unique_ptr (James O'Beirne) Pull request description: 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: https://github.com/bitcoin/bitcoin/issues/21766 See also: https://github.com/google/leveldb/issues/142#issuecomment-414418135 ACKs for top commit: MarcoFalke: review ACK7ad414f4bf🔎 jonatack: re-ACK7ad414f4bfmodulo suggestion ryanofsky: Code review ACK7ad414f4bf. Two new commits look good and thanks for clarifying constructor comment Tree-SHA512: 6471d03e2de674d84b1ea0d31e25f433d52aa1aa4996f7b4aab1bd02b6bc340b15e64cc8ea07bbefefa3b5da35384ca5400cc230434e787c30931b8574c672f9