|
28 | 28 | #include <cxxtimer.hpp> |
29 | 29 |
|
30 | 30 | // Forward declaration to break dependency over node/transaction.h |
31 | | -std::pair<CTransactionRef, uint256> GetTransactionBlock(const uint256& hash, const CTxMemPool* const mempool); |
| 31 | +CTransactionRef GetTransaction(const CBlockIndex* const block_index, const CTxMemPool* const mempool, |
| 32 | + const uint256& hash, const Consensus::Params& consensusParams, uint256& hashBlock); |
32 | 33 |
|
33 | 34 | namespace llmq |
34 | 35 | { |
@@ -577,7 +578,8 @@ bool CInstantSendManager::CheckCanLock(const COutPoint& outpoint, bool printDebu |
577 | 578 | return false; |
578 | 579 | } |
579 | 580 |
|
580 | | - auto [tx, hashBlock] = GetTransactionBlock(outpoint.hash, &mempool); |
| 581 | + uint256 hashBlock{}; |
| 582 | + const auto tx = GetTransaction(nullptr, &mempool, outpoint.hash, params, hashBlock); |
581 | 583 | // this relies on enabled txindex and won't work if we ever try to remove the requirement for txindex for masternodes |
582 | 584 | if (!tx) { |
583 | 585 | if (printDebug) { |
@@ -634,7 +636,9 @@ void CInstantSendManager::HandleNewInputLockRecoveredSig(const CRecoveredSig& re |
634 | 636 | g_txindex->BlockUntilSyncedToCurrentChain(); |
635 | 637 | } |
636 | 638 |
|
637 | | - auto [tx, hashBlock] = GetTransactionBlock(txid, &mempool); |
| 639 | + |
| 640 | + uint256 hashBlock{}; |
| 641 | + const auto tx = GetTransaction(nullptr, &mempool, txid, Params().GetConsensus(), hashBlock); |
638 | 642 | if (!tx) { |
639 | 643 | return; |
640 | 644 | } |
@@ -1013,7 +1017,8 @@ void CInstantSendManager::ProcessInstantSendLock(NodeId from, PeerManager& peerm |
1013 | 1017 | return; |
1014 | 1018 | } |
1015 | 1019 |
|
1016 | | - auto [tx, hashBlock] = GetTransactionBlock(islock->txid, &mempool); |
| 1020 | + uint256 hashBlock{}; |
| 1021 | + const auto tx = GetTransaction(nullptr, &mempool, islock->txid, Params().GetConsensus(), hashBlock); |
1017 | 1022 | const CBlockIndex* pindexMined{nullptr}; |
1018 | 1023 | // we ignore failure here as we must be able to propagate the lock even if we don't have the TX locally |
1019 | 1024 | if (tx && !hashBlock.IsNull()) { |
|
0 commit comments