diff options
author | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2021-07-22 15:01:14 +0200 |
---|---|---|
committer | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2021-07-22 15:53:17 +0200 |
commit | abc57e1f0882a1a2bb20474648419979af6e383d (patch) | |
tree | 384f1b226cc930327681f235c14a28bc67adb4fa /src/validation.cpp | |
parent | 78f4c8b98eada337346ffb206339c3ebae4ff43b (diff) | |
download | bitcoin-abc57e1f0882a1a2bb20474648419979af6e383d.tar.xz |
refactor: move `GetTransaction(...)` to node/transaction.cpp
can be reviewed with --color-moved
Diffstat (limited to 'src/validation.cpp')
-rw-r--r-- | src/validation.cpp | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index 6a145a088a..3e5cc1e77c 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -18,7 +18,6 @@ #include <flatfile.h> #include <hash.h> #include <index/blockfilterindex.h> -#include <index/txindex.h> #include <logging.h> #include <logging/timer.h> #include <node/blockstorage.h> @@ -1155,38 +1154,6 @@ PackageMempoolAcceptResult ProcessNewPackage(CChainState& active_chainstate, CTx return result; } -CTransactionRef GetTransaction(const CBlockIndex* const block_index, const CTxMemPool* const mempool, const uint256& hash, const Consensus::Params& consensusParams, uint256& hashBlock) -{ - LOCK(cs_main); - - if (mempool && !block_index) { - CTransactionRef ptx = mempool->get(hash); - if (ptx) return ptx; - } - if (g_txindex) { - CTransactionRef tx; - uint256 block_hash; - if (g_txindex->FindTx(hash, block_hash, tx)) { - if (!block_index || block_index->GetBlockHash() == block_hash) { - hashBlock = block_hash; - return tx; - } - } - } - if (block_index) { - CBlock block; - if (ReadBlockFromDisk(block, block_index, consensusParams)) { - for (const auto& tx : block.vtx) { - if (tx->GetHash() == hash) { - hashBlock = block_index->GetBlockHash(); - return tx; - } - } - } - } - return nullptr; -} - CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams) { int halvings = nHeight / consensusParams.nSubsidyHalvingInterval; |