Add AssertLockHeld assertions in CWallet::ListCoins
Summary:
- Add AssertLockHeld assertions in CWallet::ListCoins
- Add EXCLUSIVE_LOCKS_REQUIRED to CWallet::ListCoins
Suggested by MarcoFalke <falke.marco@gmail.com> in
https://github.com/bitcoin/bitcoin/pull/10605#issuecomment-417643535
This is a backport of Core PR10605
Test Plan:
- Build with clang and make sure there are no warning related to locks.
- Build in debug mode and run the extended test suite.
Reviewers: #bitcoin_abc, jasonbcox
Reviewed By: #bitcoin_abc, jasonbcox
Differential Revision: https://reviews.bitcoinabc.org/D4170