|
13 | 13 | #include <chainparams.h> |
14 | 14 | #include <consensus/validation.h> |
15 | 15 | #include <dbwrapper.h> |
16 | | -#include <evo/chainhelper.h> |
17 | 16 | #include <index/txindex.h> |
18 | 17 | #include <masternode/sync.h> |
19 | 18 | #include <net_processing.h> |
|
31 | 30 | using node::fImporting; |
32 | 31 | using node::fReindex; |
33 | 32 |
|
| 33 | +// Forward declaration to break dependency over node/transaction.h |
| 34 | +namespace node |
| 35 | +{ |
| 36 | +CTransactionRef GetTransaction(const CBlockIndex* const block_index, const CTxMemPool* const mempool, |
| 37 | + const uint256& hash, const Consensus::Params& consensusParams, uint256& hashBlock); |
| 38 | +} // namespace node |
| 39 | +using node::GetTransaction; |
| 40 | + |
34 | 41 | namespace llmq |
35 | 42 | { |
36 | 43 |
|
@@ -578,7 +585,8 @@ bool CInstantSendManager::CheckCanLock(const COutPoint& outpoint, bool printDebu |
578 | 585 | return false; |
579 | 586 | } |
580 | 587 |
|
581 | | - auto [tx, hashBlock] = GetTransactionBlock(outpoint.hash, &mempool); |
| 588 | + uint256 hashBlock{}; |
| 589 | + const auto tx = GetTransaction(nullptr, &mempool, outpoint.hash, params, hashBlock); |
582 | 590 | // this relies on enabled txindex and won't work if we ever try to remove the requirement for txindex for masternodes |
583 | 591 | if (!tx) { |
584 | 592 | if (printDebug) { |
@@ -635,7 +643,9 @@ void CInstantSendManager::HandleNewInputLockRecoveredSig(const CRecoveredSig& re |
635 | 643 | g_txindex->BlockUntilSyncedToCurrentChain(); |
636 | 644 | } |
637 | 645 |
|
638 | | - auto [tx, hashBlock] = GetTransactionBlock(txid, &mempool); |
| 646 | + |
| 647 | + uint256 hashBlock{}; |
| 648 | + const auto tx = GetTransaction(nullptr, &mempool, txid, Params().GetConsensus(), hashBlock); |
639 | 649 | if (!tx) { |
640 | 650 | return; |
641 | 651 | } |
@@ -1017,7 +1027,8 @@ void CInstantSendManager::ProcessInstantSendLock(NodeId from, PeerManager& peerm |
1017 | 1027 | return; |
1018 | 1028 | } |
1019 | 1029 |
|
1020 | | - auto [tx, hashBlock] = GetTransactionBlock(islock->txid, &mempool); |
| 1030 | + uint256 hashBlock{}; |
| 1031 | + const auto tx = GetTransaction(nullptr, &mempool, islock->txid, Params().GetConsensus(), hashBlock); |
1021 | 1032 | const CBlockIndex* pindexMined{nullptr}; |
1022 | 1033 | // we ignore failure here as we must be able to propagate the lock even if we don't have the TX locally |
1023 | 1034 | if (tx && !hashBlock.IsNull()) { |
|
0 commit comments