diff options
author | Karl-Johan Alm <karljohan-alm@garage.co.jp> | 2021-08-25 16:39:04 +0900 |
---|---|---|
committer | Karl-Johan Alm <karljohan-alm@garage.co.jp> | 2021-10-25 16:12:21 +0900 |
commit | 54011e7aa274bdc1b921440cc8b4623aa1e0d89e (patch) | |
tree | 9237e28e520366cc35e2d9661044e24f30c1c67c /contrib | |
parent | 96461989a2de737151bc4fb216221bf49cb53ce6 (diff) |
refactor: use CWallet const shared pointers when possible
While const shared_ptr<X> gives us an immutable shared pointer to a mutable X (we can't set it to some other X later), shared_ptr<const X> gives us a shared pointer to an immutable X. Importantly, we can recast shared_ptr<X> into shared_ptr<const X>, but not the other way around. We do this for two reasons: because it makes the code safer to guarantee the wallet is not modified, and because it further dispells the misconception that const shared_ptr<X> gives immutability to X.
Diffstat (limited to 'contrib')
0 files changed, 0 insertions, 0 deletions