@@ -2015,11 +2015,16 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
20152015 if (strCommand == NetMsgType::TX) {
20162016 vRecv >> ptx;
20172017 txLockRequest = CTxLockRequest (ptx);
2018- fCanAutoLock = CInstantSend::CanAutoLock () && txLockRequest.IsSimple ();
2018+ fCanAutoLock = llmq::IsOldInstantSendEnabled () && CInstantSend::CanAutoLock () && txLockRequest.IsSimple ();
20192019 } else if (strCommand == NetMsgType::TXLOCKREQUEST) {
20202020 vRecv >> txLockRequest;
20212021 ptx = txLockRequest.tx ;
20222022 nInvType = MSG_TXLOCK_REQUEST;
2023+ if (llmq::IsNewInstantSendEnabled ()) {
2024+ // the new system does not require explicit lock requests
2025+ // changing the inv type to MSG_TX also results in re-broadcasting the TX as normal TX
2026+ nInvType = MSG_TX;
2027+ }
20232028 } else if (strCommand == NetMsgType::DSTX) {
20242029 vRecv >> dstx;
20252030 ptx = dstx.tx ;
@@ -2035,7 +2040,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
20352040 }
20362041
20372042 // Process custom logic, no matter if tx will be accepted to mempool later or not
2038- if (strCommand == NetMsgType::TXLOCKREQUEST || fCanAutoLock ) {
2043+ if (nInvType == MSG_TXLOCK_REQUEST || fCanAutoLock ) {
20392044 if (!instantsend.ProcessTxLockRequest (txLockRequest, connman)) {
20402045 LogPrint (" instantsend" , " TXLOCKREQUEST -- failed %s\n " , txLockRequest.GetHash ().ToString ());
20412046 // Should not really happen for "fCanAutoLock == true" but just in case:
@@ -2046,7 +2051,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
20462051 // Fallback for normal txes to process as usual
20472052 fCanAutoLock = false ;
20482053 }
2049- } else if (strCommand == NetMsgType::DSTX ) {
2054+ } else if (nInvType == MSG_DSTX ) {
20502055 uint256 hashTx = tx.GetHash ();
20512056 if (CPrivateSend::GetDSTX (hashTx)) {
20522057 LogPrint (" privatesend" , " DSTX -- Already have %s, skipping...\n " , hashTx.ToString ());
@@ -2083,11 +2088,11 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
20832088
20842089 if (!AlreadyHave (inv) && AcceptToMemoryPool (mempool, state, ptx, true , &fMissingInputs )) {
20852090 // Process custom txes, this changes AlreadyHave to "true"
2086- if (strCommand == NetMsgType::DSTX ) {
2091+ if (nInvType == MSG_DSTX ) {
20872092 LogPrintf (" DSTX -- Masternode transaction accepted, txid=%s, peer=%d\n " ,
20882093 tx.GetHash ().ToString (), pfrom->id );
20892094 CPrivateSend::AddDSTX (dstx);
2090- } else if (strCommand == NetMsgType::TXLOCKREQUEST || fCanAutoLock ) {
2095+ } else if (nInvType == MSG_TXLOCK_REQUEST || fCanAutoLock ) {
20912096 LogPrintf (" TXLOCKREQUEST -- Transaction Lock Request accepted, txid=%s, peer=%d\n " ,
20922097 tx.GetHash ().ToString (), pfrom->id );
20932098 instantsend.AcceptLockRequest (txLockRequest);
@@ -2208,7 +2213,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
22082213 }
22092214 }
22102215
2211- if (strCommand == NetMsgType::TXLOCKREQUEST && !AlreadyHave (inv)) {
2216+ if (nInvType == MSG_TXLOCK_REQUEST && !AlreadyHave (inv)) {
22122217 // i.e. AcceptToMemoryPool failed, probably because it's conflicting
22132218 // with existing normal tx or tx lock for another tx. For the same tx lock
22142219 // AlreadyHave would have return "true" already.
0 commit comments