2
2
// Distributed under the MIT software license, see the accompanying
3
3
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
4
5
- #ifndef DASH_QUORUMS_INSTANTX_H
6
- #define DASH_QUORUMS_INSTANTX_H
5
+ #ifndef DASH_QUORUMS_INSTANTSEND_H
6
+ #define DASH_QUORUMS_INSTANTSEND_H
7
7
8
8
#include " quorums_signing.h"
9
9
@@ -18,7 +18,7 @@ class CScheduler;
18
18
namespace llmq
19
19
{
20
20
21
- class CInstantXLock
21
+ class CInstantSendLock
22
22
{
23
23
public:
24
24
std::vector<COutPoint> inputs;
@@ -39,14 +39,14 @@ class CInstantXLock
39
39
uint256 GetRequestId () const ;
40
40
};
41
41
42
- class CInstantXLockInfo
42
+ class CInstantSendLockInfo
43
43
{
44
44
public:
45
- // might be nullptr when ixlock is received before the TX itself
45
+ // might be nullptr when islock is received before the TX itself
46
46
CTransactionRef tx;
47
- CInstantXLock ixlock ;
47
+ CInstantSendLock islock ;
48
48
// only valid when recovered sig was received
49
- uint256 ixlockHash ;
49
+ uint256 islockHash ;
50
50
// time when it was created/received
51
51
int64_t time;
52
52
@@ -68,27 +68,27 @@ class CInstantSendManager : public CRecoveredSigsListener
68
68
std::unordered_map<uint256, uint256, StaticSaltedHasher> inputVotes;
69
69
70
70
/* *
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.
74
74
*/
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 ;
78
78
79
79
/* *
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 .
82
82
*/
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 ;
87
87
88
88
const CBlockIndex* pindexLastChainLock{nullptr };
89
89
90
90
// 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 ;
92
92
bool hasScheduledProcessPending{false };
93
93
94
94
public:
@@ -108,27 +108,27 @@ class CInstantSendManager : public CRecoveredSigsListener
108
108
109
109
virtual void HandleNewRecoveredSig (const CRecoveredSig& recoveredSig);
110
110
void HandleNewInputLockRecoveredSig (const CRecoveredSig& recoveredSig, const uint256& txid);
111
- void HandleNewInstantXLockRecoveredSig (const CRecoveredSig& recoveredSig);
111
+ void HandleNewInstantSendLockRecoveredSig (const CRecoveredSig& recoveredSig);
112
112
113
- void TrySignInstantXLock (const CTransaction& tx);
113
+ void TrySignInstantSendLock (const CTransaction& tx);
114
114
115
115
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 );
120
120
void UpdateWalletTransaction (const uint256& txid);
121
121
122
122
void SyncTransaction (const CTransaction &tx, const CBlockIndex *pindex, int posInBlock);
123
123
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);
126
126
127
- void RemoveMempoolConflictsForLock (const uint256& hash, const CInstantXLock& ixlock );
127
+ void RemoveMempoolConflictsForLock (const uint256& hash, const CInstantSendLock& islock );
128
128
void RetryLockMempoolTxs (const uint256& lockedParentTx);
129
129
130
130
bool AlreadyHave (const CInv& inv);
131
- bool GetInstantXLockByHash (const uint256& hash, CInstantXLock & ret);
131
+ bool GetInstantSendLockByHash (const uint256& hash, CInstantSendLock & ret);
132
132
};
133
133
134
134
extern CInstantSendManager* quorumInstantSendManager;
@@ -144,4 +144,4 @@ bool IsInstantSendEnabled();
144
144
145
145
}
146
146
147
- #endif // DASH_QUORUMS_INSTANTX_H
147
+ #endif // DASH_QUORUMS_INSTANTSEND_H
0 commit comments