|
6 | 6 | #define BITCOIN_COINJOIN_COINJOIN_H |
7 | 7 |
|
8 | 8 | #include <coinjoin/common.h> |
| 9 | +#include <coinjoin/queue.h> |
| 10 | +#include <coinjoin/params.h> |
9 | 11 |
|
10 | 12 | #include <core_io.h> |
11 | 13 | #include <netaddress.h> |
@@ -41,8 +43,6 @@ extern RecursiveMutex cs_main; |
41 | 43 | // timeouts |
42 | 44 | static constexpr int COINJOIN_AUTO_TIMEOUT_MIN = 5; |
43 | 45 | static constexpr int COINJOIN_AUTO_TIMEOUT_MAX = 15; |
44 | | -static constexpr int COINJOIN_QUEUE_TIMEOUT = 30; |
45 | | -static constexpr int COINJOIN_SIGNING_TIMEOUT = 15; |
46 | 46 |
|
47 | 47 | static constexpr size_t COINJOIN_ENTRY_MAX_SIZE = 9; |
48 | 48 |
|
@@ -173,63 +173,7 @@ class CCoinJoinEntry |
173 | 173 | }; |
174 | 174 |
|
175 | 175 |
|
176 | | -/** |
177 | | - * A currently in progress mixing merge and denomination information |
178 | | - */ |
179 | | -class CCoinJoinQueue |
180 | | -{ |
181 | | -public: |
182 | | - int nDenom{0}; |
183 | | - COutPoint masternodeOutpoint; |
184 | | - uint256 m_protxHash; |
185 | | - int64_t nTime{0}; |
186 | | - bool fReady{false}; //ready for submit |
187 | | - std::vector<unsigned char> vchSig; |
188 | | - // memory only |
189 | | - bool fTried{false}; |
190 | | - |
191 | | - CCoinJoinQueue() = default; |
192 | | - |
193 | | - CCoinJoinQueue(int nDenom, const COutPoint& outpoint, const uint256& proTxHash, int64_t nTime, bool fReady) : |
194 | | - nDenom(nDenom), |
195 | | - masternodeOutpoint(outpoint), |
196 | | - m_protxHash(proTxHash), |
197 | | - nTime(nTime), |
198 | | - fReady(fReady) |
199 | | - { |
200 | | - } |
201 | | - |
202 | | - SERIALIZE_METHODS(CCoinJoinQueue, obj) |
203 | | - { |
204 | | - READWRITE(obj.nDenom, obj.m_protxHash, obj.nTime, obj.fReady); |
205 | | - if (!(s.GetType() & SER_GETHASH)) { |
206 | | - READWRITE(obj.vchSig); |
207 | | - } |
208 | | - } |
209 | | - |
210 | | - [[nodiscard]] uint256 GetHash() const; |
211 | | - [[nodiscard]] uint256 GetSignatureHash() const; |
212 | | - /** Sign this mixing transaction |
213 | | - * return true if all conditions are met: |
214 | | - * 1) we have an active Masternode, |
215 | | - * 2) we have a valid Masternode private key, |
216 | | - * 3) we signed the message successfully, and |
217 | | - * 4) we verified the message successfully |
218 | | - */ |
219 | | - bool Sign(const CActiveMasternodeManager& mn_activeman); |
220 | | - /// Check if we have a valid Masternode address |
221 | | - [[nodiscard]] bool CheckSignature(const CBLSPublicKey& blsPubKey) const; |
222 | | - |
223 | | - /// Check if a queue is too old or too far into the future |
224 | | - [[nodiscard]] bool IsTimeOutOfBounds(int64_t current_time = GetAdjustedTime()) const; |
225 | | - |
226 | | - [[nodiscard]] std::string ToString() const; |
227 | | - |
228 | | - friend bool operator==(const CCoinJoinQueue& a, const CCoinJoinQueue& b) |
229 | | - { |
230 | | - return a.nDenom == b.nDenom && a.masternodeOutpoint == b.masternodeOutpoint && a.nTime == b.nTime && a.fReady == b.fReady; |
231 | | - } |
232 | | -}; |
| 176 | +// CCoinJoinQueue moved to coinjoin/queue.h |
233 | 177 |
|
234 | 178 | /** Helper class to store mixing transaction (tx) information. |
235 | 179 | */ |
|
0 commit comments