Skip to content

Commit 114972b

Browse files
authored
Merge pull request zcash#6918 from nuttycom/improve_gettransaction_constness
Add const modifer to the `blockIndex` argument to `GetTransaction`
2 parents 82bbcf0 + 3cc7e9a commit 114972b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2062,9 +2062,9 @@ bool GetAddressUnspent(const uint160& addressHash, int type,
20622062
* Return transaction in txOut, and if it was found inside a block, its hash is placed in hashBlock.
20632063
* If blockIndex is provided, the transaction is fetched from the corresponding block.
20642064
*/
2065-
bool GetTransaction(const uint256& hash, CTransaction& txOut, const Consensus::Params& consensusParams, uint256& hashBlock, bool fAllowSlow, CBlockIndex* blockIndex)
2065+
bool GetTransaction(const uint256& hash, CTransaction& txOut, const Consensus::Params& consensusParams, uint256& hashBlock, bool fAllowSlow, const CBlockIndex* blockIndex)
20662066
{
2067-
CBlockIndex* pindexSlow = blockIndex;
2067+
const CBlockIndex* pindexSlow = blockIndex;
20682068

20692069
LOCK(cs_main);
20702070

src/main.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ bool TestSetIBD(bool);
307307
/** Format a string that describes several potential problems detected by the core */
308308
std::pair<std::string, int64_t> GetWarnings(const std::string& strFor);
309309
/** Retrieve a transaction (from memory pool, or from disk, if possible) */
310-
bool GetTransaction(const uint256& hash, CTransaction& tx, const Consensus::Params& params, uint256& hashBlock, bool fAllowSlow = false, CBlockIndex* blockIndex = nullptr);
310+
bool GetTransaction(const uint256& hash, CTransaction& tx, const Consensus::Params& params, uint256& hashBlock, bool fAllowSlow = false, const CBlockIndex* blockIndex = nullptr);
311311
/** Find the best known block, and make it the tip of the block chain */
312312
bool ActivateBestChain(CValidationState& state, const CChainParams& chainparams, const CBlock* pblock = NULL);
313313
CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams);

0 commit comments

Comments
 (0)