|
46 | 46 | #include "evo/deterministicmns.h"
|
47 | 47 | #include "evo/cbtx.h"
|
48 | 48 |
|
| 49 | +#include "llmq/quorums_instantsend.h" |
49 | 50 | #include "llmq/quorums_chainlocks.h"
|
50 | 51 |
|
51 | 52 | #include <atomic>
|
@@ -692,6 +693,18 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
|
692 | 693 | REJECT_INVALID, "tx-txlock-conflict");
|
693 | 694 | }
|
694 | 695 |
|
| 696 | + uint256 txConflictHash; |
| 697 | + if (llmq::quorumInstantSendManager->GetConflictingTx(tx, txConflictHash)) { |
| 698 | + CTransactionRef txConflict; |
| 699 | + uint256 hashBlock; |
| 700 | + if (GetTransaction(txConflictHash, txConflict, Params().GetConsensus(), hashBlock)) { |
| 701 | + GetMainSignals().NotifyInstantSendDoubleSpendAttempt(tx, *txConflict); |
| 702 | + } |
| 703 | + return state.DoS(10, error("AcceptToMemoryPool : Transaction %s conflicts with locked TX %s", |
| 704 | + hash.ToString(), txConflictHash.ToString()), |
| 705 | + REJECT_INVALID, "tx-txlock-conflict"); |
| 706 | + } |
| 707 | + |
695 | 708 | // Check for conflicts with in-memory transactions
|
696 | 709 | {
|
697 | 710 | LOCK(pool.cs); // protect pool.mapNextTx
|
@@ -3278,6 +3291,15 @@ bool CheckBlock(const CBlock& block, CValidationState& state, const Consensus::P
|
3278 | 3291 | strprintf("transaction %s conflicts with transaction lock %s", tx->GetHash().ToString(), hashLocked.ToString()));
|
3279 | 3292 | }
|
3280 | 3293 | }
|
| 3294 | + uint256 txConflict; |
| 3295 | + if (llmq::quorumInstantSendManager->GetConflictingTx(*tx, txConflict)) { |
| 3296 | + // The node which relayed this will have to switch later, |
| 3297 | + // relaying instantsend data won't help it. |
| 3298 | + LOCK(cs_main); |
| 3299 | + mapRejectedBlocks.insert(std::make_pair(block.GetHash(), GetTime())); |
| 3300 | + return state.DoS(100, false, REJECT_INVALID, "conflict-tx-lock", false, |
| 3301 | + strprintf("transaction %s conflicts with transaction lock %s", tx->GetHash().ToString(), txConflict.ToString())); |
| 3302 | + } |
3281 | 3303 | }
|
3282 | 3304 | } else {
|
3283 | 3305 | LogPrintf("CheckBlock(DASH): spork is off, skipping transaction locking checks\n");
|
|
0 commit comments