Split out from #19556
Instead of relying on the implicit mempool global, pass a mempool pointer (which can be 0
). This helps with testing, code clarity and unlocks the features described in #19556.
ACK https://github.com/bitcoin/bitcoin/pull/19604/commits/faabb459fe168d02a5e587000ebfad46b06bf7cc
Will test locally soon.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
82@@ -83,7 +83,8 @@ void AppTests::appTests()
83 // Reset global state to avoid interfering with later tests.
84 LogInstance().DisconnectTestLogger();
85 AbortShutdown();
86- UnloadBlockIndex();
87+ CTxMemPool dummy;
88+ UnloadBlockIndex(&dummy);
ACK fae8c28dae747f9c4c6481049742346d18202fc8 (jamesob/ackr/19604.1.MarcoFalke.pass_mempool_pointer_to
)
Built locally and ran unittests.
0Tested on Linux-4.19.0-9-amd64-x86_64-with-glibc2.28
1
2Configured with ./configure LDFLAGS=-L/home/james/src/bitcoin/db4/lib/ CPPFLAGS=-I/home/james/src/bitcoin/db4/include/ CXXFLAGS=-std=c++11 -Wthread-safety-analysis -Werror --enable-wallet --enable-debug --with-daemon CXX=/usr/bin/clang++ CC=/usr/bin/clang --disable-shared --with-pic --enable-benchmark=no --with-bignum=no --enable-module-recovery --disable-jni --no-create --no-recursion
3
4Compiled with /usr/bin/ccache /usr/bin/clang++ -std=c++11 -mavx -mavx2 -std=c++11 -Wthread-safety-analysis -Werror -O0 -g3 -ftrapv -Wstack-protector -fstack-protector-all -msse4 -msha -msse4.1 -msse4.2 i
5
6Compiler version: clang version 7.0.1-8 (tags/RELEASE_701/final)
0-----BEGIN PGP SIGNED MESSAGE-----
1Hash: SHA512
2
3ACK fae8c28dae747f9c4c6481049742346d18202fc8 ([`jamesob/ackr/19604.1.MarcoFalke.pass_mempool_pointer_to`](https://github.com/jamesob/bitcoin/tree/ackr/19604.1.MarcoFalke.pass_mempool_pointer_to))
4
5Built locally and ran unittests.
6
7<details><summary>Show platform data</summary>
8<p>
Tested on Linux-4.19.0-9-amd64-x86_64-with-glibc2.28
Configured with ./configure LDFLAGS=-L/home/james/src/bitcoin/db4/lib/ CPPFLAGS=-I/home/james/src/bitcoin/db4/include/ CXXFLAGS=-std=c++11 -Wthread-safety-analysis -Werror –enable-wallet –enable-debug –with-daemon CXX=/usr/bin/clang++ CC=/usr/bin/clang –disable-shared –with-pic –enable-benchmark=no –with-bignum=no –enable-module-recovery –disable-jni –no-create –no-recursion
Compiled with /usr/bin/ccache /usr/bin/clang++ -std=c++11 -mavx -mavx2 -std=c++11 -Wthread-safety-analysis -Werror -O0 -g3 -ftrapv -Wstack-protector -fstack-protector-all -msse4 -msha -msse4.1 -msse4.2 i
Compiler version: clang version 7.0.1-8 (tags/RELEASE_701/final)
0
1</p></details>
2-----BEGIN PGP SIGNATURE-----
3
4iQIzBAEBCgAdFiEEpm2+LMqPsWj2rAwWyrywS1A+5mgFAl8hfCAACgkQyrywS1A+
55mgfqg//fT5WYUt3TfjmMu+QR1mi5y8XAi+H0YQ9Jxmt3PZI7NdEwe/WNENO+s1J
6nBw7Z+NI5F+u0pEB2s517aUQBVUjL0W9yyRQ3Y2m2fsObjMbH2dPR2RWn72Hheub
7dis1vfJpbp3Jzz6dWQzGd5E19HNN+3oJCgZ3HQbjm9+yPuKfajQuQ4KXhly47eHZ
8DDANRUHuTJITYxb8wge++xNiFaG0hTdhbBX01A5cCg20XUDx6DiCzEt61thBlYGF
91Zp5ddRCDbER1pLn7K1U0Lg1b5tVnOVu6kO0G9cMXNYnHlVOKlBupVOvKFZZKIQO
10Pl8lXMc0cLUcCBWsSzkw2xLVSiRVPwaQ9bFo/zlPZUNRwxdx6kUrTPXpYS8sZmgu
11qdykwMcqmyGrS9SDr5IwiZC37gfuRPNnF24cCatUQqfFWsvnrnGwkkjmINS1SPM9
12slWMc7gZFQ2u+T46NsnhpmsJ8AmjZ6muaYyn+o5SQIZnWxRKNmGH8I73qKPoo1K8
13B4Mu31BeFsS5s9sXjBt9DmRIceWH1YXblOJp2j4lJ55fYxAsMm5/f22k41fGlDa1
14KtJ31YbXCqc1Hh4SrNlAucsmHONI7xGVs5ABrouveInj2PMascWRSZKKdk8MlD7l
15YN+zp5MykAp8/eot5qdj8W9qv7+dGuh7N9V3nyNtdUZWBeyZTDk=
16=zZ7M
17-----END PGP SIGNATURE-----