Review report

core: PR #25665

Design and approach

Should the warning downgrade be scoped to the reported false positive? (ci/test/00_setup_env_native_previous_releases.sh:26, head)

This preset explicitly uses -Werror, but -Wno-error=maybe-uninitialized makes every warning in that category nonfatal across all C++ translation units in this CI job, while leaving warnings visible. The recorded false positive is at src/wallet/test/util.cpp:143. If the issue is confined to that source or instantiation, a narrower exception would retain the workaround while keeping the job strict about this warning elsewhere. Is the same false positive known to occur in other translation units on this toolchain? If so, the broader override may be justified.

๐ŸŸ  Major

Throwing construction can destroy an inactive union member (src/util/result.h:161, head)

If constructing SuccessType at line 252 throws, the Result object is not fully constructed, but its SuccessHolder base is destroyed. With no engaged error, operator bool() reports success and the destructor calls m_success's destructor even though its lifetime never began. The same mismatch can occur during update(): move() destroys the old success value before constructing its replacement or engaging the error value, either of which can throw. For nontrivial success types, this causes undefined behavior during unwinding or later cleanup. Track the union member's lifetime independently and make transitions exception-safe.

๐ŸŸก Minor

Log the verification result on failure (src/kernel/bitcoinkernel.cpp:1147, head)

After LoadChainstate() succeeds, this branch handles a failed or interrupted VerifyLoadedChainstate() result but passes load_result to ErrorString. The successful load result normally has no messages, so the kernel log omits the verification reason. Format verify_result here.

Preserve the verification interruption diagnostic (src/node/chainstate.cpp:280, head)

This case now returns only Interrupted{}, with no result message. Previously it returned Block verification was interrupted; the kernel chainstate-manager creation path treats interrupted verification as a failure and logs the result message. Even if that caller is changed to log verify_result, this case will still provide no explanation. Preserve the interruption diagnostic or emit an equivalent message at the caller.

๐Ÿ’ก Suggestion

Join messages without copying both vectors (src/util/messages.cpp:16, head)

The initializer-list elements here are vector values initialized from messages.errors and messages.warnings, so each JoinMessages() call copies both collections and their strings before iterating them. Iterating the vectors by reference, or using references or pointers to them, preserves the errors-then-warnings order and spacing while avoiding temporary copies and allocations.

Review coverage was incomplete. The adversarial review had incomplete evidence. The adversarial_glm review did not complete.