Skip to content

Commit 2299ee2

Browse files
committed
Rename IXLOCK to ISLOCK and InstantX to InstantSend
1 parent f5dcb00 commit 2299ee2

9 files changed

+198
-198
lines changed

src/llmq/quorums_chainlocks.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ void CChainLocksHandler::TrySignChainTip()
307307
}
308308
}
309309

310-
if (txAge < WAIT_FOR_IXLOCK_TIMEOUT && !quorumInstantSendManager->IsLocked(txid)) {
310+
if (txAge < WAIT_FOR_ISLOCK_TIMEOUT && !quorumInstantSendManager->IsLocked(txid)) {
311311
LogPrintf("CChainLocksHandler::%s -- not signing block %s due to TX %s not being ixlocked and not old enough. age=%d\n", __func__,
312312
pindexWalk->GetBlockHash().ToString(), txid.ToString(), txAge);
313313
return;
@@ -396,7 +396,7 @@ bool CChainLocksHandler::IsTxSafeForMining(const uint256& txid)
396396
}
397397
}
398398

399-
if (txAge < WAIT_FOR_IXLOCK_TIMEOUT && !quorumInstantSendManager->IsLocked(txid)) {
399+
if (txAge < WAIT_FOR_ISLOCK_TIMEOUT && !quorumInstantSendManager->IsLocked(txid)) {
400400
return false;
401401
}
402402
return true;

src/llmq/quorums_chainlocks.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class CChainLocksHandler : public CRecoveredSigsListener
4747
static const int64_t CLEANUP_SEEN_TIMEOUT = 24 * 60 * 60 * 1000;
4848

4949
// how long to wait for ixlocks until we consider a block with non-ixlocked TXs to be safe to sign
50-
static const int64_t WAIT_FOR_IXLOCK_TIMEOUT = 10 * 60;
50+
static const int64_t WAIT_FOR_ISLOCK_TIMEOUT = 10 * 60;
5151

5252
private:
5353
CScheduler* scheduler;

src/llmq/quorums_instantsend.cpp

+151-151
Large diffs are not rendered by default.

src/llmq/quorums_instantsend.h

+31-31
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
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;
1818
namespace llmq
1919
{
2020

21-
class CInstantXLock
21+
class CInstantSendLock
2222
{
2323
public:
2424
std::vector<COutPoint> inputs;
@@ -39,14 +39,14 @@ class CInstantXLock
3939
uint256 GetRequestId() const;
4040
};
4141

42-
class CInstantXLockInfo
42+
class CInstantSendLockInfo
4343
{
4444
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
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

9494
public:
@@ -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

134134
extern CInstantSendManager* quorumInstantSendManager;
@@ -144,4 +144,4 @@ bool IsInstantSendEnabled();
144144

145145
}
146146

147-
#endif//DASH_QUORUMS_INSTANTX_H
147+
#endif//DASH_QUORUMS_INSTANTSEND_H

src/llmq/quorums_signing.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ void CSigningManager::ProcessRecoveredSig(NodeId nodeId, const CRecoveredSig& re
543543
} else {
544544
// Looks like we're trying to process a recSig that is already known. This might happen if the same
545545
// recSig comes in through regular QRECSIG messages and at the same time through some other message
546-
// which allowed to reconstruct a recSig (e.g. IXLOCK). In this case, just bail out.
546+
// which allowed to reconstruct a recSig (e.g. ISLOCK). In this case, just bail out.
547547
}
548548
return;
549549
} else {

src/net_processing.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@ bool static AlreadyHave(const CInv& inv) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
977977
return llmq::quorumSigningManager->AlreadyHave(inv);
978978
case MSG_CLSIG:
979979
return llmq::chainLocksHandler->AlreadyHave(inv);
980-
case MSG_IXLOCK:
980+
case MSG_ISLOCK:
981981
return llmq::quorumInstantSendManager->AlreadyHave(inv);
982982
}
983983

@@ -1299,10 +1299,10 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam
12991299
}
13001300
}
13011301

1302-
if (!push && (inv.type == MSG_IXLOCK)) {
1303-
llmq::CInstantXLock o;
1304-
if (llmq::quorumInstantSendManager->GetInstantXLockByHash(inv.hash, o)) {
1305-
connman.PushMessage(pfrom, msgMaker.Make(NetMsgType::IXLOCK, o));
1302+
if (!push && (inv.type == MSG_ISLOCK)) {
1303+
llmq::CInstantSendLock o;
1304+
if (llmq::quorumInstantSendManager->GetInstantSendLockByHash(inv.hash, o)) {
1305+
connman.PushMessage(pfrom, msgMaker.Make(NetMsgType::ISLOCK, o));
13061306
push = true;
13071307
}
13081308
}
@@ -1788,7 +1788,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
17881788
case MSG_CLSIG:
17891789
doubleRequestDelay = 5 * 1000000;
17901790
break;
1791-
case MSG_IXLOCK:
1791+
case MSG_ISLOCK:
17921792
doubleRequestDelay = 5 * 1000000;
17931793
break;
17941794
}

src/protocol.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const char *QGETSIGSHARES="qgetsigs";
7171
const char *QBSIGSHARES="qbsigs";
7272
const char *QSIGREC="qsigrec";
7373
const char *CLSIG="clsig";
74-
const char *IXLOCK="ixlock";
74+
const char *ISLOCK="islock";
7575
};
7676

7777
static const char* ppszTypeName[] =
@@ -108,7 +108,7 @@ static const char* ppszTypeName[] =
108108
NetMsgType::QDEBUGSTATUS,
109109
NetMsgType::QSIGREC,
110110
NetMsgType::CLSIG,
111-
NetMsgType::IXLOCK,
111+
NetMsgType::ISLOCK,
112112
};
113113

114114
/** All known message types. Keep this in the same order as the list of
@@ -174,7 +174,7 @@ const static std::string allNetMessageTypes[] = {
174174
NetMsgType::QBSIGSHARES,
175175
NetMsgType::QSIGREC,
176176
NetMsgType::CLSIG,
177-
NetMsgType::IXLOCK,
177+
NetMsgType::ISLOCK,
178178
};
179179
const static std::vector<std::string> allNetMessageTypesVec(allNetMessageTypes, allNetMessageTypes+ARRAYLEN(allNetMessageTypes));
180180

src/protocol.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ extern const char *QGETSIGSHARES;
277277
extern const char *QBSIGSHARES;
278278
extern const char *QSIGREC;
279279
extern const char *CLSIG;
280-
extern const char *IXLOCK;
280+
extern const char *ISLOCK;
281281
};
282282

283283
/* Get a vector of all valid message types (see above) */
@@ -380,7 +380,7 @@ enum GetDataMsg {
380380
MSG_QUORUM_DEBUG_STATUS = 27,
381381
MSG_QUORUM_RECOVERED_SIG = 28,
382382
MSG_CLSIG = 29,
383-
MSG_IXLOCK = 30,
383+
MSG_ISLOCK = 30,
384384
};
385385

386386
/** inv message data */

src/wallet/wallet.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3346,7 +3346,7 @@ bool CWallet::CreateTransaction(const std::vector<CRecipient>& vecSend, CWalletT
33463346
int& nChangePosInOut, std::string& strFailReason, const CCoinControl* coinControl, bool sign, AvailableCoinsType nCoinType, bool fUseInstantSend, int nExtraPayloadSize)
33473347
{
33483348
if (!llmq::IsOldInstantSendEnabled()) {
3349-
// The new system does not require special handling for InstantSend as this is all done in CInstantXManager.
3349+
// The new system does not require special handling for InstantSend as this is all done in CInstantSendManager.
33503350
// There is also no need for an extra fee anymore.
33513351
fUseInstantSend = false;
33523352
}

0 commit comments

Comments
 (0)