const std::shared_ptr<CWallet> wallet = x;
means we can not do wallet = y, but we can totally do wallet->DestructiveOperation(), contrary to what that line looks like.
This PR
- introduces a new convention: always use const shared pointers to
CWallets (even when we mutate the pointed-to thing) - uses
const shared_ptr<const CWallet>everywhere where wallets are not modified
In the future, this should preferably apply to all shared pointers, not limited to just CWallets.
Both of these serve the same purpose: to dispell the misconception that const shared_ptr<X> immutates X. It doesn't, and it's dangerous to leave this misconception as is, for obvious reasons.