Review report

core: PR #36451

2 suggestions

Earlier concerns neither republished nor resolved: 1 suggestion. See the Run archive for their assessments.

Optional improvements

Link

[suggestion] · CDBIterator's constructor still hides its non-null requirement

CDBIterator now stores a NotNullUniquePtr but still accepts a nullable std::unique_ptr, leaving the non-null requirement absent from its constructor signature.

Location: src/dbwrapper.h:140 (head).

Details and suggested fix

The unchanged m_impl_iter(std::move(_piter)) initializer converts the constructor's std::unique_ptr<IteratorImpl> into NotNull and asserts non-nullness at runtime. Declare and define _piter as util::NotNullUniquePtr<IteratorImpl> instead, and wrap the std::make_unique<CDBIterator::IteratorImpl>(...) argument in CDBWrapper::NewIterator with util::NotNull{...}. IteratorImpl is complete there, so this preserves allocation, ownership transfer, and the runtime assertion while exposing the requirement at the API boundary, consistent with NotNull's creation-site guidance. No current caller passes null: NewIterator is the only caller and passes a fresh allocation, so this is an API-clarity suggestion rather than a behavior fix.


Link

[suggestion] · Pimpl conversions leave four unused <memory> includes

The pimpl conversions leave unused direct <memory> includes in addrman.h, node/txreconciliation.h, txrequest.h, and test/fuzz/util/check_globals.h.

Location: src/addrman.h:113 (head).

Details and suggested fix

These four headers no longer directly name a <memory> facility after switching their pimpl members to util::NotNullUniquePtr. Remove their direct #include <memory> lines: util/not_null.h provides the alias and itself includes <memory>, so the smart-pointer definitions remain available. Keep <memory> in the current dbwrapper.h, whose constructor still names std::unique_ptr, and in node/txdownloadman.h, which still names std::shared_ptr. This is optional include hygiene, not a build or runtime fix. IWYU was not run, and these files are outside the currently enforced IWYU set.


Coverage details

Earlier concerns

Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.