22// Distributed under the MIT software license, see the accompanying
33// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44
5- #ifndef DASH_QUORUMS_INSTANTX_H
6- #define DASH_QUORUMS_INSTANTX_H
5+ #ifndef DASH_QUORUMS_INSTANTSEND_H
6+ #define DASH_QUORUMS_INSTANTSEND_H
77
88#include " quorums_signing.h"
99
@@ -18,7 +18,7 @@ class CScheduler;
1818namespace llmq
1919{
2020
21- class CInstantXLock
21+ class CInstantSendLock
2222{
2323public:
2424 std::vector<COutPoint> inputs;
@@ -39,14 +39,14 @@ class CInstantXLock
3939 uint256 GetRequestId () const ;
4040};
4141
42- class CInstantXLockInfo
42+ class CInstantSendLockInfo
4343{
4444public:
45- // might be nullptr when ixlock is received before the TX itself
45+ // might be nullptr when islock is received before the TX itself
4646 CTransactionRef tx;
47- CInstantXLock ixlock ;
47+ CInstantSendLock islock ;
4848 // only valid when recovered sig was received
49- uint256 ixlockHash ;
49+ uint256 islockHash ;
5050 // time when it was created/received
5151 int64_t time;
5252
@@ -68,27 +68,27 @@ class CInstantSendManager : public CRecoveredSigsListener
6868 std::unordered_map<uint256, uint256, StaticSaltedHasher> inputVotes;
6969
7070 /* *
71- * These are the ixlocks that are currently in the middle of being created. Entries are created when we observed
72- * recovered signatures for all inputs of a TX. At the same time, we initiate signing of our sigshare for the ixlock .
73- * When the recovered sig for the ixlock later arrives, we can finish the ixlock and propagate it.
71+ * These are the islocks that are currently in the middle of being created. Entries are created when we observed
72+ * recovered signatures for all inputs of a TX. At the same time, we initiate signing of our sigshare for the islock .
73+ * When the recovered sig for the islock later arrives, we can finish the islock and propagate it.
7474 */
75- std::unordered_map<uint256, CInstantXLockInfo , StaticSaltedHasher> creatingInstantXLocks ;
76- // maps from txid to the in-progress ixlock
77- std::unordered_map<uint256, CInstantXLockInfo *, StaticSaltedHasher> txToCreatingInstantXLocks ;
75+ std::unordered_map<uint256, CInstantSendLockInfo , StaticSaltedHasher> creatingInstantSendLocks ;
76+ // maps from txid to the in-progress islock
77+ std::unordered_map<uint256, CInstantSendLockInfo *, StaticSaltedHasher> txToCreatingInstantSendLocks ;
7878
7979 /* *
80- * These are the final ixlocks , indexed by their own hash. The other maps are used to get from TXs, inputs and blocks
81- * to ixlocks .
80+ * These are the final islocks , indexed by their own hash. The other maps are used to get from TXs, inputs and blocks
81+ * to islocks .
8282 */
83- std::unordered_map<uint256, CInstantXLockInfo , StaticSaltedHasher> finalInstantXLocks ;
84- std::unordered_map<uint256, CInstantXLockInfo *, StaticSaltedHasher> txToInstantXLock ;
85- std::unordered_map<COutPoint, CInstantXLockInfo *, SaltedOutpointHasher> inputToInstantXLock ;
86- std::unordered_multimap<uint256, CInstantXLockInfo *, StaticSaltedHasher> blockToInstantXLocks ;
83+ std::unordered_map<uint256, CInstantSendLockInfo , StaticSaltedHasher> finalInstantSendLocks ;
84+ std::unordered_map<uint256, CInstantSendLockInfo *, StaticSaltedHasher> txToInstantSendLock ;
85+ std::unordered_map<COutPoint, CInstantSendLockInfo *, SaltedOutpointHasher> inputToInstantSendLock ;
86+ std::unordered_multimap<uint256, CInstantSendLockInfo *, StaticSaltedHasher> blockToInstantSendLocks ;
8787
8888 const CBlockIndex* pindexLastChainLock{nullptr };
8989
9090 // Incoming and not verified yet
91- std::unordered_map<uint256, std::pair<NodeId, CInstantXLock >> pendingInstantXLocks ;
91+ std::unordered_map<uint256, std::pair<NodeId, CInstantSendLock >> pendingInstantSendLocks ;
9292 bool hasScheduledProcessPending{false };
9393
9494public:
@@ -108,27 +108,27 @@ class CInstantSendManager : public CRecoveredSigsListener
108108
109109 virtual void HandleNewRecoveredSig (const CRecoveredSig& recoveredSig);
110110 void HandleNewInputLockRecoveredSig (const CRecoveredSig& recoveredSig, const uint256& txid);
111- void HandleNewInstantXLockRecoveredSig (const CRecoveredSig& recoveredSig);
111+ void HandleNewInstantSendLockRecoveredSig (const CRecoveredSig& recoveredSig);
112112
113- void TrySignInstantXLock (const CTransaction& tx);
113+ void TrySignInstantSendLock (const CTransaction& tx);
114114
115115 void ProcessMessage (CNode* pfrom, const std::string& strCommand, CDataStream& vRecv, CConnman& connman);
116- void ProcessMessageInstantXLock (CNode* pfrom, const CInstantXLock& ixlock , CConnman& connman);
117- bool PreVerifyInstantXLock (NodeId nodeId, const CInstantXLock& ixlock , bool & retBan);
118- void ProcessPendingInstantXLocks ();
119- void ProcessInstantXLock (NodeId from, const uint256& hash, const CInstantXLock& ixlock );
116+ void ProcessMessageInstantSendLock (CNode* pfrom, const CInstantSendLock& islock , CConnman& connman);
117+ bool PreVerifyInstantSendLock (NodeId nodeId, const CInstantSendLock& islock , bool & retBan);
118+ void ProcessPendingInstantSendLocks ();
119+ void ProcessInstantSendLock (NodeId from, const uint256& hash, const CInstantSendLock& islock );
120120 void UpdateWalletTransaction (const uint256& txid);
121121
122122 void SyncTransaction (const CTransaction &tx, const CBlockIndex *pindex, int posInBlock);
123123 void NotifyChainLock (const CBlockIndex* pindex);
124- void UpdateIxLockMinedBlock (CInstantXLockInfo* ixlockInfo , const CBlockIndex* pindex);
125- void RemoveFinalIxLock (const uint256& hash);
124+ void UpdateISLockMinedBlock (CInstantSendLockInfo* islockInfo , const CBlockIndex* pindex);
125+ void RemoveFinalISLock (const uint256& hash);
126126
127- void RemoveMempoolConflictsForLock (const uint256& hash, const CInstantXLock& ixlock );
127+ void RemoveMempoolConflictsForLock (const uint256& hash, const CInstantSendLock& islock );
128128 void RetryLockMempoolTxs (const uint256& lockedParentTx);
129129
130130 bool AlreadyHave (const CInv& inv);
131- bool GetInstantXLockByHash (const uint256& hash, CInstantXLock & ret);
131+ bool GetInstantSendLockByHash (const uint256& hash, CInstantSendLock & ret);
132132};
133133
134134extern CInstantSendManager* quorumInstantSendManager;
@@ -144,4 +144,4 @@ bool IsInstantSendEnabled();
144144
145145}
146146
147- #endif // DASH_QUORUMS_INSTANTX_H
147+ #endif // DASH_QUORUMS_INSTANTSEND_H
0 commit comments