diff --git a/src/Makefile.am b/src/Makefile.am index c8cdc24e57..fb4850429f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -427,10 +427,12 @@ libbitcoin_server_a_SOURCES = \ init.cpp \ governance/governance.cpp \ governance/classes.cpp \ + governance/exceptions.cpp \ governance/object.cpp \ governance/validators.cpp \ governance/vote.cpp \ governance/votedb.cpp \ + gsl/assert.cpp \ llmq/quorums.cpp \ llmq/blockprocessor.cpp \ llmq/commitment.cpp \ diff --git a/src/addrman.h b/src/addrman.h index 19f5576fdb..7aa6590a58 100644 --- a/src/addrman.h +++ b/src/addrman.h @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/chain.cpp b/src/chain.cpp index 685629f91a..b68b089f59 100644 --- a/src/chain.cpp +++ b/src/chain.cpp @@ -5,6 +5,26 @@ #include +#include + +std::string CDiskBlockIndex::ToString() const +{ + std::string str = "CDiskBlockIndex("; + str += CBlockIndex::ToString(); + str += strprintf("\n hashBlock=%s, hashPrev=%s)", + GetBlockHash().ToString(), + hashPrev.ToString()); + return str; +} + +std::string CBlockIndex::ToString() const +{ + return strprintf("CBlockIndex(pprev=%p, nHeight=%d, merkle=%s, hashBlock=%s)", + pprev, nHeight, + hashMerkleRoot.ToString(), + GetBlockHash().ToString()); +} + /** * CChain implementation */ diff --git a/src/chain.h b/src/chain.h index 40f81a28fe..4042f82ce0 100644 --- a/src/chain.h +++ b/src/chain.h @@ -10,7 +10,6 @@ #include #include #include -#include #include #include @@ -281,13 +280,7 @@ class CBlockIndex return pbegin[(pend - pbegin)/2]; } - std::string ToString() const - { - return strprintf("CBlockIndex(pprev=%p, nHeight=%d, merkle=%s, hashBlock=%s)", - pprev, nHeight, - hashMerkleRoot.ToString(), - GetBlockHash().ToString()); - } + std::string ToString() const; //! Check whether this block index entry is valid up to the passed validity level. bool IsValid(enum BlockStatus nUpTo = BLOCK_VALID_TRANSACTIONS) const @@ -381,16 +374,8 @@ class CDiskBlockIndex : public CBlockIndex return block.GetHash(); } + std::string ToString() const; - std::string ToString() const - { - std::string str = "CDiskBlockIndex("; - str += CBlockIndex::ToString(); - str += strprintf("\n hashBlock=%s, hashPrev=%s)", - GetBlockHash().ToString(), - hashPrev.ToString()); - return str; - } }; /** An in-memory indexed chain of blocks. */ diff --git a/src/coinjoin/client.cpp b/src/coinjoin/client.cpp index ebb90ac623..f20d51a398 100644 --- a/src/coinjoin/client.cpp +++ b/src/coinjoin/client.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -155,6 +156,15 @@ void CCoinJoinClientManager::ProcessMessage(CNode& peer, PeerManager& peerman, C } } +CCoinJoinClientSession::CCoinJoinClientSession(CWallet& pwallet, CJClientManager& clientman, const CMasternodeSync& mn_sync, + const std::unique_ptr& queueman) : + m_wallet(pwallet), + m_clientman(clientman), + m_manager(*Assert(clientman.Get(pwallet))), + m_mn_sync(mn_sync), + m_queueman(queueman) +{} + void CCoinJoinClientSession::ProcessMessage(CNode& peer, PeerManager& peerman, CConnman& connman, const CTxMemPool& mempool, std::string_view msg_type, CDataStream& vRecv) { if (fMasternodeMode) return; diff --git a/src/coinjoin/client.h b/src/coinjoin/client.h index 65ebbb88c5..8d2c883091 100644 --- a/src/coinjoin/client.h +++ b/src/coinjoin/client.h @@ -7,7 +7,6 @@ #include #include -#include #include #include @@ -165,8 +164,7 @@ class CCoinJoinClientSession : public CCoinJoinBaseSession public: explicit CCoinJoinClientSession(CWallet& pwallet, CJClientManager& clientman, const CMasternodeSync& mn_sync, - const std::unique_ptr& queueman) : - m_wallet(pwallet), m_clientman(clientman), m_manager(*Assert(clientman.Get(pwallet))), m_mn_sync(mn_sync), m_queueman(queueman) {} + const std::unique_ptr& queueman); void ProcessMessage(CNode& peer, PeerManager& peerman, CConnman& connman, const CTxMemPool& mempool, std::string_view msg_type, CDataStream& vRecv); diff --git a/src/coinjoin/coinjoin.cpp b/src/coinjoin/coinjoin.cpp index dd1d8943d9..ebb7f967ba 100644 --- a/src/coinjoin/coinjoin.cpp +++ b/src/coinjoin/coinjoin.cpp @@ -21,6 +21,7 @@ #include #include +#include #include constexpr static CAmount DEFAULT_MAX_RAW_TX_FEE{COIN / 10}; @@ -87,6 +88,12 @@ bool CCoinJoinQueue::IsTimeOutOfBounds(int64_t current_time) const nTime - current_time > COINJOIN_QUEUE_TIMEOUT; } +[[nodiscard]] std::string CCoinJoinQueue::ToString() const +{ + return strprintf("nDenom=%d, nTime=%lld, fReady=%s, fTried=%s, masternode=%s", + nDenom, nTime, fReady ? "true" : "false", fTried ? "true" : "false", masternodeOutpoint.ToStringShort()); +} + uint256 CCoinJoinBroadcastTx::GetSignatureHash() const { return SerializeHash(*this, SER_GETHASH, PROTOCOL_VERSION); diff --git a/src/coinjoin/coinjoin.h b/src/coinjoin/coinjoin.h index 30fe8f9f44..8f56aa61b6 100644 --- a/src/coinjoin/coinjoin.h +++ b/src/coinjoin/coinjoin.h @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -238,11 +237,7 @@ class CCoinJoinQueue /// Check if a queue is too old or too far into the future [[nodiscard]] bool IsTimeOutOfBounds(int64_t current_time = GetAdjustedTime()) const; - [[nodiscard]] std::string ToString() const - { - return strprintf("nDenom=%d, nTime=%lld, fReady=%s, fTried=%s, masternode=%s", - nDenom, nTime, fReady ? "true" : "false", fTried ? "true" : "false", masternodeOutpoint.ToStringShort()); - } + [[nodiscard]] std::string ToString() const; friend bool operator==(const CCoinJoinQueue& a, const CCoinJoinQueue& b) { diff --git a/src/consensus/tx_verify.cpp b/src/consensus/tx_verify.cpp index e7fcc762d4..de0c4c0173 100644 --- a/src/consensus/tx_verify.cpp +++ b/src/consensus/tx_verify.cpp @@ -9,6 +9,7 @@ #include