Skip to content

Commit 0073b66

Browse files
committed
refactor: migrate some Dash code to use ChainstateManager::ProcessTransaction
1 parent c8571c0 commit 0073b66

File tree

15 files changed

+71
-71
lines changed

15 files changed

+71
-71
lines changed

src/coinjoin/client.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ bool CCoinJoinClientManager::CheckAutomaticBackup()
793793
//
794794
// Passively run mixing in the background to mix funds based on the given configuration.
795795
//
796-
bool CCoinJoinClientSession::DoAutomaticDenominating(CChainState& active_chainstate, CConnman& connman, CTxMemPool& mempool, bool fDryRun)
796+
bool CCoinJoinClientSession::DoAutomaticDenominating(ChainstateManager& chainman, CConnman& connman, const CTxMemPool& mempool, bool fDryRun)
797797
{
798798
if (m_is_masternode) return false; // no client-side mixing on masternodes
799799
if (nState != POOL_STATE_IDLE) return false;
@@ -946,7 +946,7 @@ bool CCoinJoinClientSession::DoAutomaticDenominating(CChainState& active_chainst
946946
return false;
947947
}
948948
} else {
949-
if (!CoinJoin::IsCollateralValid(active_chainstate, mempool, CTransaction(txMyCollateral))) {
949+
if (!CoinJoin::IsCollateralValid(chainman, mempool, CTransaction(txMyCollateral))) {
950950
WalletCJLogPrint(m_wallet, "CCoinJoinClientSession::DoAutomaticDenominating -- invalid collateral, recreating...\n");
951951
if (!CreateCollateralTransaction(txMyCollateral, strReason)) {
952952
WalletCJLogPrint(m_wallet, "CCoinJoinClientSession::DoAutomaticDenominating -- create collateral error: %s\n", strReason);
@@ -973,7 +973,7 @@ bool CCoinJoinClientSession::DoAutomaticDenominating(CChainState& active_chainst
973973
return false;
974974
}
975975

976-
bool CCoinJoinClientManager::DoAutomaticDenominating(CChainState& active_chainstate, CConnman& connman, CTxMemPool& mempool, bool fDryRun)
976+
bool CCoinJoinClientManager::DoAutomaticDenominating(ChainstateManager& chainman, CConnman& connman, const CTxMemPool& mempool, bool fDryRun)
977977
{
978978
if (m_is_masternode) return false; // no client-side mixing on masternodes
979979
if (!CCoinJoinClientOptions::IsEnabled() || !IsMixing()) return false;
@@ -1016,7 +1016,7 @@ bool CCoinJoinClientManager::DoAutomaticDenominating(CChainState& active_chainst
10161016
return false;
10171017
}
10181018

1019-
fResult &= session.DoAutomaticDenominating(active_chainstate, connman, mempool, fDryRun);
1019+
fResult &= session.DoAutomaticDenominating(chainman, connman, mempool, fDryRun);
10201020
}
10211021

10221022
return fResult;
@@ -1864,7 +1864,7 @@ void CCoinJoinClientQueueManager::DoMaintenance()
18641864
CheckQueue();
18651865
}
18661866

1867-
void CCoinJoinClientManager::DoMaintenance(CChainState& active_chainstate, CConnman& connman, CTxMemPool& mempool)
1867+
void CCoinJoinClientManager::DoMaintenance(ChainstateManager& chainman, CConnman& connman, const CTxMemPool& mempool)
18681868
{
18691869
if (!CCoinJoinClientOptions::IsEnabled()) return;
18701870
if (m_is_masternode) return; // no client-side mixing on masternodes
@@ -1878,7 +1878,7 @@ void CCoinJoinClientManager::DoMaintenance(CChainState& active_chainstate, CConn
18781878
CheckTimeout();
18791879
ProcessPendingDsaRequest(connman);
18801880
if (nDoAutoNextRun == nTick) {
1881-
DoAutomaticDenominating(active_chainstate, connman, mempool);
1881+
DoAutomaticDenominating(chainman, connman, mempool);
18821882
nDoAutoNextRun = nTick + COINJOIN_AUTO_TIMEOUT_MIN + GetRandInt(COINJOIN_AUTO_TIMEOUT_MAX - COINJOIN_AUTO_TIMEOUT_MIN);
18831883
}
18841884
}
@@ -1930,7 +1930,7 @@ void CoinJoinWalletManager::DoMaintenance()
19301930
{
19311931
LOCK(cs_wallet_manager_map);
19321932
for (auto& [_, clientman] : m_wallet_manager_map) {
1933-
clientman->DoMaintenance(m_chainstate, m_connman, m_mempool);
1933+
clientman->DoMaintenance(m_chainman, m_connman, m_mempool);
19341934
}
19351935
}
19361936

src/coinjoin/client.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ class CCoinJoinClientQueueManager;
2222
class CConnman;
2323
class CDeterministicMN;
2424
class CDeterministicMNManager;
25-
class CNode;
25+
class ChainstateManager;
2626
class CMasternodeMetaMan;
2727
class CMasternodeSync;
28+
class CNode;
2829
class CoinJoinWalletManager;
2930
class CTxMemPool;
3031

@@ -74,9 +75,9 @@ class CoinJoinWalletManager {
7475
using wallet_name_cjman_map = std::map<const std::string, std::unique_ptr<CCoinJoinClientManager>>;
7576

7677
public:
77-
CoinJoinWalletManager(CChainState& chainstate, CConnman& connman, CDeterministicMNManager& dmnman, CMasternodeMetaMan& mn_metaman, CTxMemPool& mempool,
78+
CoinJoinWalletManager(ChainstateManager& chainman, CConnman& connman, CDeterministicMNManager& dmnman, CMasternodeMetaMan& mn_metaman, const CTxMemPool& mempool,
7879
const CMasternodeSync& mn_sync, const std::unique_ptr<CCoinJoinClientQueueManager>& queueman, bool is_masternode)
79-
: m_chainstate(chainstate), m_connman(connman), m_dmnman(dmnman), m_mn_metaman(mn_metaman), m_mempool(mempool), m_mn_sync(mn_sync),
80+
: m_chainman(chainman), m_connman(connman), m_dmnman(dmnman), m_mn_metaman(mn_metaman), m_mempool(mempool), m_mn_sync(mn_sync),
8081
m_queueman(queueman), m_is_masternode{is_masternode}
8182
{}
8283

@@ -112,11 +113,11 @@ class CoinJoinWalletManager {
112113
};
113114

114115
private:
115-
CChainState& m_chainstate;
116+
ChainstateManager& m_chainman;
116117
CConnman& m_connman;
117118
CDeterministicMNManager& m_dmnman;
118119
CMasternodeMetaMan& m_mn_metaman;
119-
CTxMemPool& m_mempool;
120+
const CTxMemPool& m_mempool;
120121
const CMasternodeSync& m_mn_sync;
121122
const std::unique_ptr<CCoinJoinClientQueueManager>& m_queueman;
122123

@@ -202,7 +203,7 @@ class CCoinJoinClientSession : public CCoinJoinBaseSession
202203
bool GetMixingMasternodeInfo(CDeterministicMNCPtr& ret) const;
203204

204205
/// Passively run mixing in the background according to the configuration in settings
205-
bool DoAutomaticDenominating(CChainState& active_chainstate, CConnman& connman, CTxMemPool& mempool, bool fDryRun = false) EXCLUSIVE_LOCKS_REQUIRED(!cs_coinjoin);
206+
bool DoAutomaticDenominating(ChainstateManager& chainman, CConnman& connman, const CTxMemPool& mempool, bool fDryRun = false) EXCLUSIVE_LOCKS_REQUIRED(!cs_coinjoin);
206207

207208
/// As a client, submit part of a future mixing transaction to a Masternode to start the process
208209
bool SubmitDenominate(CConnman& connman);
@@ -310,7 +311,7 @@ class CCoinJoinClientManager
310311
bool GetMixingMasternodesInfo(std::vector<CDeterministicMNCPtr>& vecDmnsRet) const EXCLUSIVE_LOCKS_REQUIRED(!cs_deqsessions);
311312

312313
/// Passively run mixing in the background according to the configuration in settings
313-
bool DoAutomaticDenominating(CChainState& active_chainstate, CConnman& connman, CTxMemPool& mempool, bool fDryRun = false) EXCLUSIVE_LOCKS_REQUIRED(!cs_deqsessions);
314+
bool DoAutomaticDenominating(ChainstateManager& chainman, CConnman& connman, const CTxMemPool& mempool, bool fDryRun = false) EXCLUSIVE_LOCKS_REQUIRED(!cs_deqsessions);
314315

315316
bool TrySubmitDenominate(const CService& mnAddr, CConnman& connman) EXCLUSIVE_LOCKS_REQUIRED(!cs_deqsessions);
316317
bool MarkAlreadyJoinedQueueAsTried(CCoinJoinQueue& dsq) const EXCLUSIVE_LOCKS_REQUIRED(!cs_deqsessions);
@@ -326,7 +327,7 @@ class CCoinJoinClientManager
326327

327328
void UpdatedBlockTip(const CBlockIndex* pindex);
328329

329-
void DoMaintenance(CChainState& active_chainstate, CConnman& connman, CTxMemPool& mempool) EXCLUSIVE_LOCKS_REQUIRED(!cs_deqsessions);
330+
void DoMaintenance(ChainstateManager& chainman, CConnman& connman, const CTxMemPool& mempool) EXCLUSIVE_LOCKS_REQUIRED(!cs_deqsessions);
330331

331332
void GetJsonInfo(UniValue& obj) const EXCLUSIVE_LOCKS_REQUIRED(!cs_deqsessions);
332333
};

src/coinjoin/coinjoin.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -308,10 +308,10 @@ bool CCoinJoinBaseSession::IsValidInOuts(CChainState& active_chainstate, const C
308308

309309
// Responsibility for checking fee sanity is moved from the mempool to the client (BroadcastTransaction)
310310
// but CoinJoin still requires ATMP with fee sanity checks so we need to implement them separately
311-
bool ATMPIfSaneFee(CChainState& active_chainstate, CTxMemPool& pool, const CTransactionRef &tx, bool test_accept) {
311+
bool ATMPIfSaneFee(ChainstateManager& chainman, const CTransactionRef &tx, bool test_accept) {
312312
AssertLockHeld(cs_main);
313313

314-
const MempoolAcceptResult result = AcceptToMemoryPool(active_chainstate, pool, tx, /* bypass_limits */ false, /* test_accept */ true);
314+
const MempoolAcceptResult result = chainman.ProcessTransaction(tx, /*test_accept=*/true);
315315
if (result.m_result_type != MempoolAcceptResult::ResultType::VALID) {
316316
/* Fetch fee and fast-fail if ATMP fails regardless */
317317
return false;
@@ -322,11 +322,11 @@ bool ATMPIfSaneFee(CChainState& active_chainstate, CTxMemPool& pool, const CTran
322322
/* Don't re-run ATMP if only doing test run */
323323
return true;
324324
}
325-
return AcceptToMemoryPool(active_chainstate, pool, tx, /* bypass_limits */ false, test_accept).m_result_type == MempoolAcceptResult::ResultType::VALID;
325+
return chainman.ProcessTransaction(tx, test_accept).m_result_type == MempoolAcceptResult::ResultType::VALID;
326326
}
327327

328328
// check to make sure the collateral provided by the client is valid
329-
bool CoinJoin::IsCollateralValid(CChainState& active_chainstate, CTxMemPool& mempool, const CTransaction& txCollateral)
329+
bool CoinJoin::IsCollateralValid(ChainstateManager& chainman, const CTxMemPool& mempool, const CTransaction& txCollateral)
330330
{
331331
if (txCollateral.vout.empty()) return false;
332332
if (txCollateral.nLockTime != 0) return false;
@@ -352,7 +352,7 @@ bool CoinJoin::IsCollateralValid(CChainState& active_chainstate, CTxMemPool& mem
352352
return false;
353353
}
354354
nValueIn += mempoolTx->vout[txin.prevout.n].nValue;
355-
} else if (GetUTXOCoin(active_chainstate, txin.prevout, coin)) {
355+
} else if (GetUTXOCoin(chainman.ActiveChainstate(), txin.prevout, coin)) {
356356
nValueIn += coin.out.nValue;
357357
} else {
358358
LogPrint(BCLog::COINJOIN, "CoinJoin::IsCollateralValid -- Unknown inputs in collateral transaction, txCollateral=%s", txCollateral.ToString()); /* Continued */
@@ -370,8 +370,8 @@ bool CoinJoin::IsCollateralValid(CChainState& active_chainstate, CTxMemPool& mem
370370

371371
{
372372
LOCK(cs_main);
373-
if (!ATMPIfSaneFee(active_chainstate, mempool, MakeTransactionRef(txCollateral), /*test_accept=*/true)) {
374-
LogPrint(BCLog::COINJOIN, "CoinJoin::IsCollateralValid -- didn't pass AcceptToMemoryPool()\n");
373+
if (!ATMPIfSaneFee(chainman, MakeTransactionRef(txCollateral), /*test_accept=*/true)) {
374+
LogPrint(BCLog::COINJOIN, "CoinJoin::IsCollateralValid -- didn't pass ATMPIfSaneFee()\n");
375375
return false;
376376
}
377377
}

src/coinjoin/coinjoin.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class CChainState;
2727
class CConnman;
2828
class CBLSPublicKey;
2929
class CBlockIndex;
30+
class ChainstateManager;
3031
class CMasternodeSync;
3132
class CTxMemPool;
3233
class TxValidationState;
@@ -368,7 +369,7 @@ namespace CoinJoin
368369
constexpr CAmount GetMaxPoolAmount() { return COINJOIN_ENTRY_MAX_SIZE * vecStandardDenominations.front(); }
369370

370371
/// If the collateral is valid given by a client
371-
bool IsCollateralValid(CChainState& active_chainstate, CTxMemPool& mempool, const CTransaction& txCollateral);
372+
bool IsCollateralValid(ChainstateManager& chainman, const CTxMemPool& mempool, const CTransaction& txCollateral);
372373

373374
}
374375

@@ -402,7 +403,6 @@ class CDSTXManager
402403

403404
};
404405

405-
bool ATMPIfSaneFee(CChainState& active_chainstate, CTxMemPool& pool,
406-
const CTransactionRef &tx, bool test_accept = false) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
406+
bool ATMPIfSaneFee(ChainstateManager& chainman, const CTransactionRef &tx, bool test_accept = false) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
407407

408408
#endif // BITCOIN_COINJOIN_COINJOIN_H

src/coinjoin/context.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@
99
#endif // ENABLE_WALLET
1010
#include <coinjoin/server.h>
1111

12-
CJContext::CJContext(CChainState& chainstate, CConnman& connman, CDeterministicMNManager& dmnman,
12+
CJContext::CJContext(ChainstateManager& chainman, CConnman& connman, CDeterministicMNManager& dmnman,
1313
CMasternodeMetaMan& mn_metaman, CTxMemPool& mempool,
1414
const CActiveMasternodeManager* const mn_activeman, const CMasternodeSync& mn_sync,
1515
std::unique_ptr<PeerManager>& peerman, bool relay_txes) :
1616
dstxman{std::make_unique<CDSTXManager>()},
1717
#ifdef ENABLE_WALLET
18-
walletman{std::make_unique<CoinJoinWalletManager>(chainstate, connman, dmnman, mn_metaman, mempool, mn_sync,
18+
walletman{std::make_unique<CoinJoinWalletManager>(chainman, connman, dmnman, mn_metaman, mempool, mn_sync,
1919
queueman, /* is_masternode = */ mn_activeman != nullptr)},
2020
queueman{relay_txes
2121
? std::make_unique<CCoinJoinClientQueueManager>(connman, peerman, *walletman, dmnman, mn_metaman,
2222
mn_sync, /* is_masternode = */ mn_activeman != nullptr)
2323
: nullptr},
2424
#endif // ENABLE_WALLET
25-
server{std::make_unique<CCoinJoinServer>(chainstate, connman, dmnman, *dstxman, mn_metaman, mempool, mn_activeman,
25+
server{std::make_unique<CCoinJoinServer>(chainman, connman, dmnman, *dstxman, mn_metaman, mempool, mn_activeman,
2626
mn_sync, peerman)}
2727
{}
2828

src/coinjoin/context.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313

1414
class CActiveMasternodeManager;
1515
class CBlockPolicyEstimator;
16-
class CChainState;
1716
class CCoinJoinServer;
1817
class CConnman;
1918
class CDeterministicMNManager;
2019
class CDSTXManager;
20+
class ChainstateManager;
2121
class CMasternodeMetaMan;
2222
class CMasternodeSync;
2323
class CTxMemPool;
@@ -31,7 +31,7 @@ class CoinJoinWalletManager;
3131
struct CJContext {
3232
CJContext() = delete;
3333
CJContext(const CJContext&) = delete;
34-
CJContext(CChainState& chainstate, CConnman& connman, CDeterministicMNManager& dmnman,
34+
CJContext(ChainstateManager& chainman, CConnman& connman, CDeterministicMNManager& dmnman,
3535
CMasternodeMetaMan& mn_metaman, CTxMemPool& mempool, const CActiveMasternodeManager* const mn_activeman,
3636
const CMasternodeSync& mn_sync, std::unique_ptr<PeerManager>& peerman, bool relay_txes);
3737
~CJContext();

src/coinjoin/server.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,8 @@ void CCoinJoinServer::CommitFinalTransaction()
331331
// See if the transaction is valid
332332
TRY_LOCK(cs_main, lockMain);
333333
mempool.PrioritiseTransaction(hashTx, 0.1 * COIN);
334-
if (!lockMain || !ATMPIfSaneFee(m_chainstate, mempool, finalTransaction)) {
335-
LogPrint(BCLog::COINJOIN, "CCoinJoinServer::CommitFinalTransaction -- AcceptToMemoryPool() error: Transaction not valid\n");
334+
if (!lockMain || !ATMPIfSaneFee(m_chainman, finalTransaction)) {
335+
LogPrint(BCLog::COINJOIN, "CCoinJoinServer::CommitFinalTransaction -- ATMPIfSaneFee() error: Transaction not valid\n");
336336
WITH_LOCK(cs_coinjoin, SetNull());
337337
// not much we can do in this case, just notify clients
338338
RelayCompletedTransaction(ERR_INVALID_TX);
@@ -463,8 +463,8 @@ void CCoinJoinServer::ChargeRandomFees() const
463463
void CCoinJoinServer::ConsumeCollateral(const CTransactionRef& txref) const
464464
{
465465
LOCK(cs_main);
466-
if (!ATMPIfSaneFee(m_chainstate, mempool, txref, false /* bypass_limits */)) {
467-
LogPrint(BCLog::COINJOIN, "%s -- AcceptToMemoryPool failed\n", __func__);
466+
if (!ATMPIfSaneFee(m_chainman, txref)) {
467+
LogPrint(BCLog::COINJOIN, "%s -- ATMPIfSaneFee failed\n", __func__);
468468
} else {
469469
Assert(m_peerman)->RelayTransaction(txref->GetHash());
470470
LogPrint(BCLog::COINJOIN, "%s -- Collateral was consumed\n", __func__);
@@ -582,7 +582,7 @@ bool CCoinJoinServer::AddEntry(const CCoinJoinEntry& entry, PoolMessage& nMessag
582582
return false;
583583
}
584584

585-
if (!CoinJoin::IsCollateralValid(m_chainstate, mempool, *entry.txCollateral)) {
585+
if (!CoinJoin::IsCollateralValid(m_chainman, mempool, *entry.txCollateral)) {
586586
LogPrint(BCLog::COINJOIN, "CCoinJoinServer::%s -- ERROR: collateral not valid!\n", __func__);
587587
nMessageIDRet = ERR_INVALID_COLLATERAL;
588588
return false;
@@ -616,7 +616,7 @@ bool CCoinJoinServer::AddEntry(const CCoinJoinEntry& entry, PoolMessage& nMessag
616616
}
617617

618618
bool fConsumeCollateral{false};
619-
if (!IsValidInOuts(m_chainstate, mempool, vin, entry.vecTxOut, nMessageIDRet, &fConsumeCollateral)) {
619+
if (!IsValidInOuts(m_chainman.ActiveChainstate(), mempool, vin, entry.vecTxOut, nMessageIDRet, &fConsumeCollateral)) {
620620
LogPrint(BCLog::COINJOIN, "CCoinJoinServer::%s -- ERROR! IsValidInOuts() failed: %s\n", __func__, CoinJoin::GetMessageByID(nMessageIDRet).translated);
621621
if (fConsumeCollateral) {
622622
ConsumeCollateral(entry.txCollateral);
@@ -693,7 +693,7 @@ bool CCoinJoinServer::IsAcceptableDSA(const CCoinJoinAccept& dsa, PoolMessage& n
693693
}
694694

695695
// check collateral
696-
if (!fUnitTest && !CoinJoin::IsCollateralValid(m_chainstate, mempool, CTransaction(dsa.txCollateral))) {
696+
if (!fUnitTest && !CoinJoin::IsCollateralValid(m_chainman, mempool, CTransaction(dsa.txCollateral))) {
697697
LogPrint(BCLog::COINJOIN, "CCoinJoinServer::%s -- collateral not valid!\n", __func__);
698698
nMessageIDRet = ERR_INVALID_COLLATERAL;
699699
return false;

src/coinjoin/server.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
#include <protocol.h>
1111

1212
class CActiveMasternodeManager;
13-
class CChainState;
1413
class CCoinJoinServer;
1514
class CDataStream;
1615
class CDeterministicMNManager;
1716
class CDSTXManager;
17+
class ChainstateManager;
1818
class CMasternodeMetaMan;
1919
class CNode;
2020
class CTxMemPool;
@@ -27,7 +27,7 @@ class UniValue;
2727
class CCoinJoinServer : public CCoinJoinBaseSession, public CCoinJoinBaseManager
2828
{
2929
private:
30-
CChainState& m_chainstate;
30+
ChainstateManager& m_chainman;
3131
CConnman& connman;
3232
CDeterministicMNManager& m_dmnman;
3333
CDSTXManager& m_dstxman;
@@ -90,11 +90,11 @@ class CCoinJoinServer : public CCoinJoinBaseSession, public CCoinJoinBaseManager
9090
void SetNull() override EXCLUSIVE_LOCKS_REQUIRED(cs_coinjoin);
9191

9292
public:
93-
explicit CCoinJoinServer(CChainState& chainstate, CConnman& _connman, CDeterministicMNManager& dmnman,
93+
explicit CCoinJoinServer(ChainstateManager& chainman, CConnman& _connman, CDeterministicMNManager& dmnman,
9494
CDSTXManager& dstxman, CMasternodeMetaMan& mn_metaman, CTxMemPool& mempool,
9595
const CActiveMasternodeManager* const mn_activeman, const CMasternodeSync& mn_sync,
9696
std::unique_ptr<PeerManager>& peerman) :
97-
m_chainstate(chainstate),
97+
m_chainman(chainman),
9898
connman(_connman),
9999
m_dmnman(dmnman),
100100
m_dstxman(dstxman),

src/init.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1891,7 +1891,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
18911891
node.llmq_ctx->Stop();
18921892
}
18931893
node.llmq_ctx.reset();
1894-
node.llmq_ctx = std::make_unique<LLMQContext>(chainman.ActiveChainstate(), *node.connman, *node.dmnman, *node.evodb, *node.mn_metaman, *node.mnhf_manager, *node.sporkman,
1894+
node.llmq_ctx = std::make_unique<LLMQContext>(chainman, *node.connman, *node.dmnman, *node.evodb, *node.mn_metaman, *node.mnhf_manager, *node.sporkman,
18951895
*node.mempool, node.mn_activeman.get(), *node.mn_sync, node.peerman, /* unit_tests = */ false, /* wipe = */ fReset || fReindexChainState);
18961896
// Enable CMNHFManager::{Process, Undo}Block
18971897
node.mnhf_manager->ConnectManagers(node.chainman.get(), node.llmq_ctx->qman.get());
@@ -2153,7 +2153,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
21532153

21542154
// ********************************************************* Step 7c: Setup CoinJoin
21552155

2156-
node.cj_ctx = std::make_unique<CJContext>(chainman.ActiveChainstate(), *node.connman, *node.dmnman, *node.mn_metaman, *node.mempool,
2156+
node.cj_ctx = std::make_unique<CJContext>(chainman, *node.connman, *node.dmnman, *node.mn_metaman, *node.mempool,
21572157
node.mn_activeman.get(), *node.mn_sync, node.peerman, !ignores_incoming_txs);
21582158

21592159
#ifdef ENABLE_WALLET

0 commit comments

Comments
 (0)