Review report

bitcoin/bitcoin: PR #36781

1 suggestion

Optional improvements

Link

[suggestion] · Static wallet helpers retain unnecessary standalone prototypes

The new prototypes for OutputGetChange and FindNonChangeParentOutput duplicate signatures unnecessarily; their lock annotations can live on the definitions without changing behavior or thread-safety checking.

Location: src/wallet/receive.cpp:79 (head).

Details and suggested fix

When making these helpers static, the PR replaces their header declarations with prototypes immediately above their definitions. Both definitions precede their only callers, TxGetChange and ListCoins, so these prototypes are unnecessary for lookup. Move EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet) onto each definition and retain FindNonChangeParentOutput's doc comment there, following the existing PreconditionChecks pattern in wallet/feebumper.cpp. Do not simply delete the prototypes, since they currently carry the only lock annotations. This is a small consistency and maintenance improvement, not a behavior or locking fix.


Coverage details