[refactor] Make signals optional in mempool and chainman

This is done in preparation for the next two commits, where the
CMainSignals are de-globalized.

This avoids adding new constructor arguments to the ChainstateManager
and CTxMemPool classes over the next two commits.

This could also allow future tests that are only interested in the
internal behaviour of the classes to forgo instantiating the signals.
This commit is contained in:
TheCharlatan
2024-01-24 10:28:55 +01:00
parent 7143d43884
commit 3fba3d5dee
11 changed files with 72 additions and 39 deletions

View File

@@ -40,6 +40,7 @@
#include <vector>
class CChain;
class CMainSignals;
/** Fake height value used in Coin to signify they are only in the memory pool (since 0.8) */
static const uint32_t MEMPOOL_HEIGHT = 0x7FFFFFFF;
@@ -447,6 +448,8 @@ public:
const Limits m_limits;
CMainSignals* const m_signals;
/** Create a new CTxMemPool.
* Sanity checks will be off by default for performance, because otherwise
* accepting transactions becomes O(N^2) where N is the number of transactions