Skip to content

Commit 5cba8e2

Browse files
8c3ff61 chore: apply some `clang-format-diff.py` suggestions (Kittywhiskers Van Gogh) aa1f56f merge bitcoin#22626: Remove txindex migration code (Kittywhiskers Van Gogh) 145d94d merge bitcoin#23636: Remove GetAdjustedTime from init.cpp (Kittywhiskers Van Gogh) 150ca00 merge bitcoin#23683: valid but different LockPoints after a reorg (Kittywhiskers Van Gogh) e85862b merge bitcoin#23649: circular dependency followups (Kittywhiskers Van Gogh) 8ab9929 merge bitcoin#22677: cut the validation <-> txmempool circular dependency (Kittywhiskers Van Gogh) ee49383 merge bitcoin#23211: move `update_*` structs from txmempool.h to .cpp file (Kittywhiskers Van Gogh) 3d769c7 merge bitcoin#23249: ParseByteUnits - Parse a string with suffix unit (Kittywhiskers Van Gogh) edd0bab chore: remove superfluous `ParseHDKeypath` definition (Kittywhiskers Van Gogh) 0073b66 refactor: migrate some Dash code to use `ChainstateManager::ProcessTransaction` (Kittywhiskers Van Gogh) c8571c0 merge bitcoin#23173: Add `ChainstateManager::ProcessTransaction` (Kittywhiskers Van Gogh) a21bfd0 merge bitcoin#23157: improve performance of check() and remove dependency on validation (Kittywhiskers Van Gogh) b35dc72 merge bitcoin#23185: Add ParseMoney and ParseScript tests (Kittywhiskers Van Gogh) 7c03133 merge bitcoin#22987: Fix "RuntimeError: Event loop is closed" on Windows (Kittywhiskers Van Gogh) ba60d54 merge bitcoin#22772: hasher cleanup (follow-up to bitcoin#19935) (Kittywhiskers Van Gogh) Pull request description: ## Additional Information * When backporting [bitcoin#23173](bitcoin#23173), `bypass_limits` had to be extended to `ChainstateManager::ProcessTransaction()` as Dash allows the `sendrawtransaction` RPC to bypass limits with the optional `bypasslimits` boolean (introduced in [dash#2110](#2110)). The bool arguments are not in alphabetical order to prevent breakage with Bitcoin code that expects `bypass_limits` to always be `false`. ## Breaking Changes None expected. ## Checklist - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas **(note: N/A)** - [x] I have added or updated relevant unit/integration/functional/e2e tests - [x] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: UdjinM6: utACK 8c3ff61 PastaPastaPasta: utACK 8c3ff61 Tree-SHA512: ea1eaad7279b6608a07c1175e5c3b44385d42e33afa8ce5160d871fc9b37a014e9981eafca379ac3ad6dc141b5fda6f1e676b4cc9658a6d1775fe929a134ff67
2 parents fa6132f + 8c3ff61 commit 5cba8e2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+642
-498
lines changed

doc/release-notes-6296.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Updated settings
2+
----------------
3+
4+
- `-maxuploadtarget` now allows human readable byte units [k|K|m|M|g|G|t|T].
5+
E.g. `-maxuploadtarget=500g`. No whitespace, +- or fractions allowed.
6+
Default is `M` if no suffix provided.

src/Makefile.test.include

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,9 @@ BITCOIN_TESTS =\
150150
test/script_p2sh_tests.cpp \
151151
test/script_p2pk_tests.cpp \
152152
test/script_p2pkh_tests.cpp \
153-
test/script_tests.cpp \
153+
test/script_parse_tests.cpp \
154154
test/script_standard_tests.cpp \
155+
test/script_tests.cpp \
155156
test/scriptnum_tests.cpp \
156157
test/serfloat_tests.cpp \
157158
test/serialize_tests.cpp \

src/bench/block_assemble.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ static void AssembleBlock(benchmark::Bench& bench)
3939
txs.at(b) = MakeTransactionRef(tx);
4040
}
4141
{
42-
LOCK(::cs_main); // Required for ::AcceptToMemoryPool.
42+
LOCK(::cs_main);
4343

4444
for (const auto& txr : txs) {
45-
const MempoolAcceptResult res = ::AcceptToMemoryPool(test_setup->m_node.chainman->ActiveChainstate(), *test_setup->m_node.mempool, txr, false /* bypass_limits */);
45+
const MempoolAcceptResult res = test_setup->m_node.chainman->ProcessTransaction(txr);
4646
assert(res.m_result_type == MempoolAcceptResult::ResultType::VALID);
4747
}
4848
}

src/bench/mempool_stress.cpp

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <policy/policy.h>
77
#include <test/util/setup_common.h>
88
#include <txmempool.h>
9+
#include <validation.h>
910

1011
#include <vector>
1112

@@ -26,14 +27,8 @@ struct Available {
2627
Available(CTransactionRef& ref, size_t tx_count) : ref(ref), tx_count(tx_count){}
2728
};
2829

29-
static void ComplexMemPool(benchmark::Bench& bench)
30+
static std::vector<CTransactionRef> CreateOrderedCoins(FastRandomContext& det_rand, int childTxs, int min_ancestors)
3031
{
31-
int childTxs = 800;
32-
if (bench.complexityN() > 1) {
33-
childTxs = static_cast<int>(bench.complexityN());
34-
}
35-
36-
FastRandomContext det_rand{true};
3732
std::vector<Available> available_coins;
3833
std::vector<CTransactionRef> ordered_coins;
3934
// Create some base transactions
@@ -57,8 +52,10 @@ static void ComplexMemPool(benchmark::Bench& bench)
5752
size_t idx = det_rand.randrange(available_coins.size());
5853
Available coin = available_coins[idx];
5954
uint256 hash = coin.ref->GetHash();
60-
// biased towards taking just one ancestor, but maybe more
61-
size_t n_to_take = det_rand.randrange(2) == 0 ? 1 : 1+det_rand.randrange(coin.ref->vout.size() - coin.vin_left);
55+
// biased towards taking min_ancestors parents, but maybe more
56+
size_t n_to_take = det_rand.randrange(2) == 0 ?
57+
min_ancestors :
58+
min_ancestors + det_rand.randrange(coin.ref->vout.size() - coin.vin_left);
6259
for (size_t i = 0; i < n_to_take; ++i) {
6360
tx.vin.emplace_back();
6461
tx.vin.back().prevout = COutPoint(hash, coin.vin_left++);
@@ -77,6 +74,17 @@ static void ComplexMemPool(benchmark::Bench& bench)
7774
ordered_coins.emplace_back(MakeTransactionRef(tx));
7875
available_coins.emplace_back(ordered_coins.back(), tx_counter++);
7976
}
77+
return ordered_coins;
78+
}
79+
80+
static void ComplexMemPool(benchmark::Bench& bench)
81+
{
82+
FastRandomContext det_rand{true};
83+
int childTxs = 800;
84+
if (bench.complexityN() > 1) {
85+
childTxs = static_cast<int>(bench.complexityN());
86+
}
87+
std::vector<CTransactionRef> ordered_coins = CreateOrderedCoins(det_rand, childTxs, /* min_ancestors */ 1);
8088
const auto testing_setup = MakeNoLogFileContext<const TestingSetup>(CBaseChainParams::MAIN);
8189
CTxMemPool pool;
8290
LOCK2(cs_main, pool.cs);
@@ -89,4 +97,21 @@ static void ComplexMemPool(benchmark::Bench& bench)
8997
});
9098
}
9199

100+
static void MempoolCheck(benchmark::Bench& bench)
101+
{
102+
FastRandomContext det_rand{true};
103+
const int childTxs = bench.complexityN() > 1 ? static_cast<int>(bench.complexityN()) : 2000;
104+
const std::vector<CTransactionRef> ordered_coins = CreateOrderedCoins(det_rand, childTxs, /* min_ancestors */ 5);
105+
const auto testing_setup = MakeNoLogFileContext<const TestingSetup>(CBaseChainParams::MAIN, {"-checkmempool=1"});
106+
CTxMemPool pool;
107+
LOCK2(cs_main, pool.cs);
108+
const CCoinsViewCache& coins_tip = testing_setup.get()->m_node.chainman->ActiveChainstate().CoinsTip();
109+
for (auto& tx : ordered_coins) AddTx(tx, pool);
110+
111+
bench.run([&]() NO_THREAD_SAFETY_ANALYSIS {
112+
pool.check(coins_tip, /* spendheight */ 2);
113+
});
114+
}
115+
92116
BENCHMARK(ComplexMemPool);
117+
BENCHMARK(MempoolCheck);

src/coinjoin/client.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,8 @@ 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,
797+
const CTxMemPool& mempool, bool fDryRun)
797798
{
798799
if (m_is_masternode) return false; // no client-side mixing on masternodes
799800
if (nState != POOL_STATE_IDLE) return false;
@@ -946,7 +947,7 @@ bool CCoinJoinClientSession::DoAutomaticDenominating(CChainState& active_chainst
946947
return false;
947948
}
948949
} else {
949-
if (!CoinJoin::IsCollateralValid(active_chainstate, mempool, CTransaction(txMyCollateral))) {
950+
if (!CoinJoin::IsCollateralValid(chainman, mempool, CTransaction(txMyCollateral))) {
950951
WalletCJLogPrint(m_wallet, "CCoinJoinClientSession::DoAutomaticDenominating -- invalid collateral, recreating...\n");
951952
if (!CreateCollateralTransaction(txMyCollateral, strReason)) {
952953
WalletCJLogPrint(m_wallet, "CCoinJoinClientSession::DoAutomaticDenominating -- create collateral error: %s\n", strReason);
@@ -973,7 +974,8 @@ bool CCoinJoinClientSession::DoAutomaticDenominating(CChainState& active_chainst
973974
return false;
974975
}
975976

976-
bool CCoinJoinClientManager::DoAutomaticDenominating(CChainState& active_chainstate, CConnman& connman, CTxMemPool& mempool, bool fDryRun)
977+
bool CCoinJoinClientManager::DoAutomaticDenominating(ChainstateManager& chainman, CConnman& connman,
978+
const CTxMemPool& mempool, bool fDryRun)
977979
{
978980
if (m_is_masternode) return false; // no client-side mixing on masternodes
979981
if (!CCoinJoinClientOptions::IsEnabled() || !IsMixing()) return false;
@@ -1016,7 +1018,7 @@ bool CCoinJoinClientManager::DoAutomaticDenominating(CChainState& active_chainst
10161018
return false;
10171019
}
10181020

1019-
fResult &= session.DoAutomaticDenominating(active_chainstate, connman, mempool, fDryRun);
1021+
fResult &= session.DoAutomaticDenominating(chainman, connman, mempool, fDryRun);
10201022
}
10211023

10221024
return fResult;
@@ -1864,7 +1866,7 @@ void CCoinJoinClientQueueManager::DoMaintenance()
18641866
CheckQueue();
18651867
}
18661868

1867-
void CCoinJoinClientManager::DoMaintenance(CChainState& active_chainstate, CConnman& connman, CTxMemPool& mempool)
1869+
void CCoinJoinClientManager::DoMaintenance(ChainstateManager& chainman, CConnman& connman, const CTxMemPool& mempool)
18681870
{
18691871
if (!CCoinJoinClientOptions::IsEnabled()) return;
18701872
if (m_is_masternode) return; // no client-side mixing on masternodes
@@ -1878,7 +1880,7 @@ void CCoinJoinClientManager::DoMaintenance(CChainState& active_chainstate, CConn
18781880
CheckTimeout();
18791881
ProcessPendingDsaRequest(connman);
18801882
if (nDoAutoNextRun == nTick) {
1881-
DoAutomaticDenominating(active_chainstate, connman, mempool);
1883+
DoAutomaticDenominating(chainman, connman, mempool);
18821884
nDoAutoNextRun = nTick + COINJOIN_AUTO_TIMEOUT_MIN + GetRandInt(COINJOIN_AUTO_TIMEOUT_MAX - COINJOIN_AUTO_TIMEOUT_MIN);
18831885
}
18841886
}
@@ -1930,7 +1932,7 @@ void CoinJoinWalletManager::DoMaintenance()
19301932
{
19311933
LOCK(cs_wallet_manager_map);
19321934
for (auto& [_, clientman] : m_wallet_manager_map) {
1933-
clientman->DoMaintenance(m_chainstate, m_connman, m_mempool);
1935+
clientman->DoMaintenance(m_chainman, m_connman, m_mempool);
19341936
}
19351937
}
19361938

src/coinjoin/client.h

Lines changed: 21 additions & 10 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,10 +75,17 @@ 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-
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_queueman(queueman), m_is_masternode{is_masternode}
78+
CoinJoinWalletManager(ChainstateManager& chainman, CConnman& connman, CDeterministicMNManager& dmnman,
79+
CMasternodeMetaMan& mn_metaman, const CTxMemPool& mempool, const CMasternodeSync& mn_sync,
80+
const std::unique_ptr<CCoinJoinClientQueueManager>& queueman, bool is_masternode) :
81+
m_chainman(chainman),
82+
m_connman(connman),
83+
m_dmnman(dmnman),
84+
m_mn_metaman(mn_metaman),
85+
m_mempool(mempool),
86+
m_mn_sync(mn_sync),
87+
m_queueman(queueman),
88+
m_is_masternode{is_masternode}
8189
{}
8290

8391
~CoinJoinWalletManager() {
@@ -112,11 +120,11 @@ class CoinJoinWalletManager {
112120
};
113121

114122
private:
115-
CChainState& m_chainstate;
123+
ChainstateManager& m_chainman;
116124
CConnman& m_connman;
117125
CDeterministicMNManager& m_dmnman;
118126
CMasternodeMetaMan& m_mn_metaman;
119-
CTxMemPool& m_mempool;
127+
const CTxMemPool& m_mempool;
120128
const CMasternodeSync& m_mn_sync;
121129
const std::unique_ptr<CCoinJoinClientQueueManager>& m_queueman;
122130

@@ -202,7 +210,8 @@ class CCoinJoinClientSession : public CCoinJoinBaseSession
202210
bool GetMixingMasternodeInfo(CDeterministicMNCPtr& ret) const;
203211

204212
/// 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);
213+
bool DoAutomaticDenominating(ChainstateManager& chainman, CConnman& connman, const CTxMemPool& mempool,
214+
bool fDryRun = false) EXCLUSIVE_LOCKS_REQUIRED(!cs_coinjoin);
206215

207216
/// As a client, submit part of a future mixing transaction to a Masternode to start the process
208217
bool SubmitDenominate(CConnman& connman);
@@ -310,7 +319,8 @@ class CCoinJoinClientManager
310319
bool GetMixingMasternodesInfo(std::vector<CDeterministicMNCPtr>& vecDmnsRet) const EXCLUSIVE_LOCKS_REQUIRED(!cs_deqsessions);
311320

312321
/// 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);
322+
bool DoAutomaticDenominating(ChainstateManager& chainman, CConnman& connman, const CTxMemPool& mempool,
323+
bool fDryRun = false) EXCLUSIVE_LOCKS_REQUIRED(!cs_deqsessions);
314324

315325
bool TrySubmitDenominate(const CService& mnAddr, CConnman& connman) EXCLUSIVE_LOCKS_REQUIRED(!cs_deqsessions);
316326
bool MarkAlreadyJoinedQueueAsTried(CCoinJoinQueue& dsq) const EXCLUSIVE_LOCKS_REQUIRED(!cs_deqsessions);
@@ -326,7 +336,8 @@ class CCoinJoinClientManager
326336

327337
void UpdatedBlockTip(const CBlockIndex* pindex);
328338

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

331342
void GetJsonInfo(UniValue& obj) const EXCLUSIVE_LOCKS_REQUIRED(!cs_deqsessions);
332343
};

src/coinjoin/coinjoin.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -308,10 +308,11 @@ 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)
312+
{
312313
AssertLockHeld(cs_main);
313314

314-
const MempoolAcceptResult result = AcceptToMemoryPool(active_chainstate, pool, tx, /* bypass_limits */ false, /* test_accept */ true);
315+
const MempoolAcceptResult result = chainman.ProcessTransaction(tx, /*test_accept=*/true);
315316
if (result.m_result_type != MempoolAcceptResult::ResultType::VALID) {
316317
/* Fetch fee and fast-fail if ATMP fails regardless */
317318
return false;
@@ -322,11 +323,11 @@ bool ATMPIfSaneFee(CChainState& active_chainstate, CTxMemPool& pool, const CTran
322323
/* Don't re-run ATMP if only doing test run */
323324
return true;
324325
}
325-
return AcceptToMemoryPool(active_chainstate, pool, tx, /* bypass_limits */ false, test_accept).m_result_type == MempoolAcceptResult::ResultType::VALID;
326+
return chainman.ProcessTransaction(tx, test_accept).m_result_type == MempoolAcceptResult::ResultType::VALID;
326327
}
327328

328329
// check to make sure the collateral provided by the client is valid
329-
bool CoinJoin::IsCollateralValid(CChainState& active_chainstate, CTxMemPool& mempool, const CTransaction& txCollateral)
330+
bool CoinJoin::IsCollateralValid(ChainstateManager& chainman, const CTxMemPool& mempool, const CTransaction& txCollateral)
330331
{
331332
if (txCollateral.vout.empty()) return false;
332333
if (txCollateral.nLockTime != 0) return false;
@@ -352,7 +353,7 @@ bool CoinJoin::IsCollateralValid(CChainState& active_chainstate, CTxMemPool& mem
352353
return false;
353354
}
354355
nValueIn += mempoolTx->vout[txin.prevout.n].nValue;
355-
} else if (GetUTXOCoin(active_chainstate, txin.prevout, coin)) {
356+
} else if (GetUTXOCoin(chainman.ActiveChainstate(), txin.prevout, coin)) {
356357
nValueIn += coin.out.nValue;
357358
} else {
358359
LogPrint(BCLog::COINJOIN, "CoinJoin::IsCollateralValid -- Unknown inputs in collateral transaction, txCollateral=%s", txCollateral.ToString()); /* Continued */
@@ -370,8 +371,8 @@ bool CoinJoin::IsCollateralValid(CChainState& active_chainstate, CTxMemPool& mem
370371

371372
{
372373
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");
374+
if (!ATMPIfSaneFee(chainman, MakeTransactionRef(txCollateral), /*test_accept=*/true)) {
375+
LogPrint(BCLog::COINJOIN, "CoinJoin::IsCollateralValid -- didn't pass ATMPIfSaneFee()\n");
375376
return false;
376377
}
377378
}

src/coinjoin/coinjoin.h

Lines changed: 4 additions & 4 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,8 +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-
372+
bool IsCollateralValid(ChainstateManager& chainman, const CTxMemPool& mempool, const CTransaction& txCollateral);
373373
}
374374

375375
class CDSTXManager
@@ -402,7 +402,7 @@ class CDSTXManager
402402

403403
};
404404

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

408408
#endif // BITCOIN_COINJOIN_COINJOIN_H

src/coinjoin/context.cpp

Lines changed: 4 additions & 4 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,
19-
queueman, /* is_masternode = */ mn_activeman != nullptr)},
18+
walletman{std::make_unique<CoinJoinWalletManager>(chainman, connman, dmnman, mn_metaman, mempool, mn_sync, queueman,
19+
/* 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();

0 commit comments

Comments
 (0)