A lot of places refer to CWallet*
’s as CWallet * const
, which translates to “an immutable pointer to a mutable CWallet
instance”; this is
- often not what the author meant, especially as a lot of these places do not at all modify the wallet object, and
- confusing, as it tends to suggest that this is a proper way to refer to a constant
CWallet
instance.
This PR changes references to wallets to const CWallet* const
whenever immutability is expected. This should result in no behavioral changes at all, and improved compile-time error checking.
Note from irc:
<sipa> sounds good to me; this is the sort of change that as long as it compiles, the behavior shouldn’t change <sipa> though in general it may lead to introducing automatic copying of objects sometimes (e.g. trying to std::move a const object will work, but generally result in a copy rather than an efficient move) <sipa> CWallet objects aren’t copied or moved though