mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 03:52:49 +01:00
chore: apply some clang-format-diff.py
suggestions
This commit is contained in:
parent
aa1f56f126
commit
8c3ff618d3
@ -793,7 +793,8 @@ bool CCoinJoinClientManager::CheckAutomaticBackup()
|
||||
//
|
||||
// Passively run mixing in the background to mix funds based on the given configuration.
|
||||
//
|
||||
bool CCoinJoinClientSession::DoAutomaticDenominating(ChainstateManager& chainman, CConnman& connman, const CTxMemPool& mempool, bool fDryRun)
|
||||
bool CCoinJoinClientSession::DoAutomaticDenominating(ChainstateManager& chainman, CConnman& connman,
|
||||
const CTxMemPool& mempool, bool fDryRun)
|
||||
{
|
||||
if (m_is_masternode) return false; // no client-side mixing on masternodes
|
||||
if (nState != POOL_STATE_IDLE) return false;
|
||||
@ -973,7 +974,8 @@ bool CCoinJoinClientSession::DoAutomaticDenominating(ChainstateManager& chainman
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CCoinJoinClientManager::DoAutomaticDenominating(ChainstateManager& chainman, CConnman& connman, const CTxMemPool& mempool, bool fDryRun)
|
||||
bool CCoinJoinClientManager::DoAutomaticDenominating(ChainstateManager& chainman, CConnman& connman,
|
||||
const CTxMemPool& mempool, bool fDryRun)
|
||||
{
|
||||
if (m_is_masternode) return false; // no client-side mixing on masternodes
|
||||
if (!CCoinJoinClientOptions::IsEnabled() || !IsMixing()) return false;
|
||||
|
@ -75,10 +75,17 @@ public:
|
||||
using wallet_name_cjman_map = std::map<const std::string, std::unique_ptr<CCoinJoinClientManager>>;
|
||||
|
||||
public:
|
||||
CoinJoinWalletManager(ChainstateManager& chainman, CConnman& connman, CDeterministicMNManager& dmnman, CMasternodeMetaMan& mn_metaman, const CTxMemPool& mempool,
|
||||
const CMasternodeSync& mn_sync, const std::unique_ptr<CCoinJoinClientQueueManager>& queueman, bool is_masternode)
|
||||
: m_chainman(chainman), m_connman(connman), m_dmnman(dmnman), m_mn_metaman(mn_metaman), m_mempool(mempool), m_mn_sync(mn_sync),
|
||||
m_queueman(queueman), m_is_masternode{is_masternode}
|
||||
CoinJoinWalletManager(ChainstateManager& chainman, CConnman& connman, CDeterministicMNManager& dmnman,
|
||||
CMasternodeMetaMan& mn_metaman, const CTxMemPool& mempool, const CMasternodeSync& mn_sync,
|
||||
const std::unique_ptr<CCoinJoinClientQueueManager>& queueman, bool is_masternode) :
|
||||
m_chainman(chainman),
|
||||
m_connman(connman),
|
||||
m_dmnman(dmnman),
|
||||
m_mn_metaman(mn_metaman),
|
||||
m_mempool(mempool),
|
||||
m_mn_sync(mn_sync),
|
||||
m_queueman(queueman),
|
||||
m_is_masternode{is_masternode}
|
||||
{}
|
||||
|
||||
~CoinJoinWalletManager() {
|
||||
@ -203,7 +210,8 @@ public:
|
||||
bool GetMixingMasternodeInfo(CDeterministicMNCPtr& ret) const;
|
||||
|
||||
/// Passively run mixing in the background according to the configuration in settings
|
||||
bool DoAutomaticDenominating(ChainstateManager& chainman, CConnman& connman, const CTxMemPool& mempool, bool fDryRun = false) EXCLUSIVE_LOCKS_REQUIRED(!cs_coinjoin);
|
||||
bool DoAutomaticDenominating(ChainstateManager& chainman, CConnman& connman, const CTxMemPool& mempool,
|
||||
bool fDryRun = false) EXCLUSIVE_LOCKS_REQUIRED(!cs_coinjoin);
|
||||
|
||||
/// As a client, submit part of a future mixing transaction to a Masternode to start the process
|
||||
bool SubmitDenominate(CConnman& connman);
|
||||
@ -311,7 +319,8 @@ public:
|
||||
bool GetMixingMasternodesInfo(std::vector<CDeterministicMNCPtr>& vecDmnsRet) const EXCLUSIVE_LOCKS_REQUIRED(!cs_deqsessions);
|
||||
|
||||
/// Passively run mixing in the background according to the configuration in settings
|
||||
bool DoAutomaticDenominating(ChainstateManager& chainman, CConnman& connman, const CTxMemPool& mempool, bool fDryRun = false) EXCLUSIVE_LOCKS_REQUIRED(!cs_deqsessions);
|
||||
bool DoAutomaticDenominating(ChainstateManager& chainman, CConnman& connman, const CTxMemPool& mempool,
|
||||
bool fDryRun = false) EXCLUSIVE_LOCKS_REQUIRED(!cs_deqsessions);
|
||||
|
||||
bool TrySubmitDenominate(const CService& mnAddr, CConnman& connman) EXCLUSIVE_LOCKS_REQUIRED(!cs_deqsessions);
|
||||
bool MarkAlreadyJoinedQueueAsTried(CCoinJoinQueue& dsq) const EXCLUSIVE_LOCKS_REQUIRED(!cs_deqsessions);
|
||||
@ -327,7 +336,8 @@ public:
|
||||
|
||||
void UpdatedBlockTip(const CBlockIndex* pindex);
|
||||
|
||||
void DoMaintenance(ChainstateManager& chainman, CConnman& connman, const CTxMemPool& mempool) EXCLUSIVE_LOCKS_REQUIRED(!cs_deqsessions);
|
||||
void DoMaintenance(ChainstateManager& chainman, CConnman& connman, const CTxMemPool& mempool)
|
||||
EXCLUSIVE_LOCKS_REQUIRED(!cs_deqsessions);
|
||||
|
||||
void GetJsonInfo(UniValue& obj) const EXCLUSIVE_LOCKS_REQUIRED(!cs_deqsessions);
|
||||
};
|
||||
|
@ -308,7 +308,8 @@ bool CCoinJoinBaseSession::IsValidInOuts(CChainState& active_chainstate, const C
|
||||
|
||||
// Responsibility for checking fee sanity is moved from the mempool to the client (BroadcastTransaction)
|
||||
// but CoinJoin still requires ATMP with fee sanity checks so we need to implement them separately
|
||||
bool ATMPIfSaneFee(ChainstateManager& chainman, const CTransactionRef &tx, bool test_accept) {
|
||||
bool ATMPIfSaneFee(ChainstateManager& chainman, const CTransactionRef& tx, bool test_accept)
|
||||
{
|
||||
AssertLockHeld(cs_main);
|
||||
|
||||
const MempoolAcceptResult result = chainman.ProcessTransaction(tx, /*test_accept=*/true);
|
||||
|
@ -370,7 +370,6 @@ namespace CoinJoin
|
||||
|
||||
/// If the collateral is valid given by a client
|
||||
bool IsCollateralValid(ChainstateManager& chainman, const CTxMemPool& mempool, const CTransaction& txCollateral);
|
||||
|
||||
}
|
||||
|
||||
class CDSTXManager
|
||||
@ -403,6 +402,7 @@ private:
|
||||
|
||||
};
|
||||
|
||||
bool ATMPIfSaneFee(ChainstateManager& chainman, const CTransactionRef &tx, bool test_accept = false) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
|
||||
bool ATMPIfSaneFee(ChainstateManager& chainman, const CTransactionRef& tx, bool test_accept = false)
|
||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main);
|
||||
|
||||
#endif // BITCOIN_COINJOIN_COINJOIN_H
|
||||
|
@ -15,8 +15,8 @@ CJContext::CJContext(ChainstateManager& chainman, CConnman& connman, CDeterminis
|
||||
std::unique_ptr<PeerManager>& peerman, bool relay_txes) :
|
||||
dstxman{std::make_unique<CDSTXManager>()},
|
||||
#ifdef ENABLE_WALLET
|
||||
walletman{std::make_unique<CoinJoinWalletManager>(chainman, connman, dmnman, mn_metaman, mempool, mn_sync,
|
||||
queueman, /* is_masternode = */ mn_activeman != nullptr)},
|
||||
walletman{std::make_unique<CoinJoinWalletManager>(chainman, connman, dmnman, mn_metaman, mempool, mn_sync, queueman,
|
||||
/* is_masternode = */ mn_activeman != nullptr)},
|
||||
queueman{relay_txes
|
||||
? std::make_unique<CCoinJoinClientQueueManager>(connman, peerman, *walletman, dmnman, mn_metaman,
|
||||
mn_sync, /* is_masternode = */ mn_activeman != nullptr)
|
||||
|
@ -18,8 +18,8 @@
|
||||
#include <llmq/signing.h>
|
||||
#include <llmq/signing_shares.h>
|
||||
|
||||
LLMQContext::LLMQContext(ChainstateManager& chainman, CConnman& connman, CDeterministicMNManager& dmnman, CEvoDB& evo_db,
|
||||
CMasternodeMetaMan& mn_metaman, CMNHFManager& mnhfman, CSporkManager& sporkman,
|
||||
LLMQContext::LLMQContext(ChainstateManager& chainman, CConnman& connman, CDeterministicMNManager& dmnman,
|
||||
CEvoDB& evo_db, CMasternodeMetaMan& mn_metaman, CMNHFManager& mnhfman, CSporkManager& sporkman,
|
||||
CTxMemPool& mempool, const CActiveMasternodeManager* const mn_activeman,
|
||||
const CMasternodeSync& mn_sync, const std::unique_ptr<PeerManager>& peerman, bool unit_tests,
|
||||
bool wipe) :
|
||||
@ -27,29 +27,32 @@ LLMQContext::LLMQContext(ChainstateManager& chainman, CConnman& connman, CDeterm
|
||||
bls_worker{std::make_shared<CBLSWorker>()},
|
||||
dkg_debugman{std::make_unique<llmq::CDKGDebugManager>()},
|
||||
quorum_block_processor{std::make_unique<llmq::CQuorumBlockProcessor>(chainman.ActiveChainstate(), dmnman, evo_db)},
|
||||
qdkgsman{std::make_unique<llmq::CDKGSessionManager>(*bls_worker, chainman.ActiveChainstate(), connman, dmnman, *dkg_debugman,
|
||||
mn_metaman, *quorum_block_processor, mn_activeman, sporkman,
|
||||
peerman, unit_tests, wipe)},
|
||||
qman{std::make_unique<llmq::CQuorumManager>(*bls_worker, chainman.ActiveChainstate(), connman, dmnman, *qdkgsman, evo_db,
|
||||
*quorum_block_processor, mn_activeman, mn_sync, sporkman, unit_tests,
|
||||
wipe)},
|
||||
sigman{std::make_unique<llmq::CSigningManager>(connman, mn_activeman, chainman.ActiveChainstate(), *qman, peerman, unit_tests, wipe)},
|
||||
qdkgsman{std::make_unique<llmq::CDKGSessionManager>(*bls_worker, chainman.ActiveChainstate(), connman, dmnman,
|
||||
*dkg_debugman, mn_metaman, *quorum_block_processor,
|
||||
mn_activeman, sporkman, peerman, unit_tests, wipe)},
|
||||
qman{std::make_unique<llmq::CQuorumManager>(*bls_worker, chainman.ActiveChainstate(), connman, dmnman, *qdkgsman,
|
||||
evo_db, *quorum_block_processor, mn_activeman, mn_sync, sporkman,
|
||||
unit_tests, wipe)},
|
||||
sigman{std::make_unique<llmq::CSigningManager>(connman, mn_activeman, chainman.ActiveChainstate(), *qman, peerman,
|
||||
unit_tests, wipe)},
|
||||
shareman{std::make_unique<llmq::CSigSharesManager>(connman, *sigman, mn_activeman, *qman, sporkman, peerman)},
|
||||
clhandler{[&]() -> llmq::CChainLocksHandler* const {
|
||||
assert(llmq::chainLocksHandler == nullptr);
|
||||
llmq::chainLocksHandler = std::make_unique<llmq::CChainLocksHandler>(chainman.ActiveChainstate(), *qman, *sigman, *shareman,
|
||||
sporkman, mempool, mn_sync, is_masternode);
|
||||
llmq::chainLocksHandler = std::make_unique<llmq::CChainLocksHandler>(chainman.ActiveChainstate(), *qman,
|
||||
*sigman, *shareman, sporkman, mempool,
|
||||
mn_sync, is_masternode);
|
||||
return llmq::chainLocksHandler.get();
|
||||
}()},
|
||||
isman{[&]() -> llmq::CInstantSendManager* const {
|
||||
assert(llmq::quorumInstantSendManager == nullptr);
|
||||
llmq::quorumInstantSendManager = std::make_unique<llmq::CInstantSendManager>(
|
||||
*llmq::chainLocksHandler, chainman.ActiveChainstate(), connman, *qman, *sigman, *shareman, sporkman,
|
||||
mempool, mn_sync, peerman, is_masternode, unit_tests, wipe);
|
||||
llmq::quorumInstantSendManager = std::make_unique<llmq::CInstantSendManager>(*llmq::chainLocksHandler,
|
||||
chainman.ActiveChainstate(),
|
||||
connman, *qman, *sigman, *shareman,
|
||||
sporkman, mempool, mn_sync, peerman,
|
||||
is_masternode, unit_tests, wipe);
|
||||
return llmq::quorumInstantSendManager.get();
|
||||
}()},
|
||||
ehfSignalsHandler{
|
||||
std::make_unique<llmq::CEHFSignalsHandler>(chainman, mnhfman, *sigman, *shareman, *qman)}
|
||||
ehfSignalsHandler{std::make_unique<llmq::CEHFSignalsHandler>(chainman, mnhfman, *sigman, *shareman, *qman)}
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -14,8 +14,8 @@
|
||||
#include <masternode/node.h>
|
||||
#include <masternode/sync.h>
|
||||
#include <messagesigner.h>
|
||||
#include <node/context.h>
|
||||
#include <net.h>
|
||||
#include <node/context.h>
|
||||
#include <rpc/blockchain.h>
|
||||
#include <rpc/server.h>
|
||||
#include <rpc/server_util.h>
|
||||
|
Loading…
Reference in New Issue
Block a user