refactor: Avoid locking tx pool cs thrice
Summary:
addUnchecked is (outside the tests) only called by ATMP, which already takes the tx pool read lock. So locking it twice more in both addUnchecked methods seems redundant.
Backport of Bitcoin Core PR13786
https://github.com/bitcoin/bitcoin/pull/13786
Test Plan:
- Build with Clang in Debug mode:
CXX=clang++ CC=clang cmake .. -GNinja -DCMAKE_BUILD_TYPE=Debug ninja check
- Verify that the compiler has not emitted a thread-safety warning.
- Run the node: ./src/bitcoind -regtest
- Verify that text similar to "Assertion failed: lock ... not held ..." is not printed on stderr.
Reviewers: Fabien, #bitcoin_abc, deadalnix
Reviewed By: Fabien, #bitcoin_abc, deadalnix
Differential Revision: https://reviews.bitcoinabc.org/D4186