@@ -2015,11 +2015,16 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
2015
2015
if (strCommand == NetMsgType::TX) {
2016
2016
vRecv >> ptx;
2017
2017
txLockRequest = CTxLockRequest (ptx);
2018
- fCanAutoLock = CInstantSend::CanAutoLock () && txLockRequest.IsSimple ();
2018
+ fCanAutoLock = llmq::IsOldInstantSendEnabled () && CInstantSend::CanAutoLock () && txLockRequest.IsSimple ();
2019
2019
} else if (strCommand == NetMsgType::TXLOCKREQUEST) {
2020
2020
vRecv >> txLockRequest;
2021
2021
ptx = txLockRequest.tx ;
2022
2022
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
+ }
2023
2028
} else if (strCommand == NetMsgType::DSTX) {
2024
2029
vRecv >> dstx;
2025
2030
ptx = dstx.tx ;
@@ -2035,7 +2040,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
2035
2040
}
2036
2041
2037
2042
// 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 ) {
2039
2044
if (!instantsend.ProcessTxLockRequest (txLockRequest, connman)) {
2040
2045
LogPrint (" instantsend" , " TXLOCKREQUEST -- failed %s\n " , txLockRequest.GetHash ().ToString ());
2041
2046
// 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
2046
2051
// Fallback for normal txes to process as usual
2047
2052
fCanAutoLock = false ;
2048
2053
}
2049
- } else if (strCommand == NetMsgType::DSTX ) {
2054
+ } else if (nInvType == MSG_DSTX ) {
2050
2055
uint256 hashTx = tx.GetHash ();
2051
2056
if (CPrivateSend::GetDSTX (hashTx)) {
2052
2057
LogPrint (" privatesend" , " DSTX -- Already have %s, skipping...\n " , hashTx.ToString ());
@@ -2083,11 +2088,11 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
2083
2088
2084
2089
if (!AlreadyHave (inv) && AcceptToMemoryPool (mempool, state, ptx, true , &fMissingInputs )) {
2085
2090
// Process custom txes, this changes AlreadyHave to "true"
2086
- if (strCommand == NetMsgType::DSTX ) {
2091
+ if (nInvType == MSG_DSTX ) {
2087
2092
LogPrintf (" DSTX -- Masternode transaction accepted, txid=%s, peer=%d\n " ,
2088
2093
tx.GetHash ().ToString (), pfrom->id );
2089
2094
CPrivateSend::AddDSTX (dstx);
2090
- } else if (strCommand == NetMsgType::TXLOCKREQUEST || fCanAutoLock ) {
2095
+ } else if (nInvType == MSG_TXLOCK_REQUEST || fCanAutoLock ) {
2091
2096
LogPrintf (" TXLOCKREQUEST -- Transaction Lock Request accepted, txid=%s, peer=%d\n " ,
2092
2097
tx.GetHash ().ToString (), pfrom->id );
2093
2098
instantsend.AcceptLockRequest (txLockRequest);
@@ -2208,7 +2213,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
2208
2213
}
2209
2214
}
2210
2215
2211
- if (strCommand == NetMsgType::TXLOCKREQUEST && !AlreadyHave (inv)) {
2216
+ if (nInvType == MSG_TXLOCK_REQUEST && !AlreadyHave (inv)) {
2212
2217
// i.e. AcceptToMemoryPool failed, probably because it's conflicting
2213
2218
// with existing normal tx or tx lock for another tx. For the same tx lock
2214
2219
// AlreadyHave would have return "true" already.
0 commit comments