Skip to content

Commit f7c4f79

Browse files
committed
[trivial] Add missing const qualifiers.
Add some const qualifiers to references that are not modified and should be marked as const.
1 parent 0ad1041 commit f7c4f79

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1468,7 +1468,7 @@ bool GetTransaction(const uint256 &hash, CTransaction &txOut, const Consensus::P
14681468
if (fAllowSlow) { // use coin database to locate block that contains transaction, and scan it
14691469
int nHeight = -1;
14701470
{
1471-
CCoinsViewCache &view = *pcoinsTip;
1471+
const CCoinsViewCache& view = *pcoinsTip;
14721472
const CCoins* coins = view.AccessCoins(hash);
14731473
if (coins)
14741474
nHeight = coins->nHeight;

src/txmempool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ bool CTxMemPool::HasNoInputsOf(const CTransaction &tx) const
885885
return true;
886886
}
887887

888-
CCoinsViewMemPool::CCoinsViewMemPool(CCoinsView *baseIn, CTxMemPool &mempoolIn) : CCoinsViewBacked(baseIn), mempool(mempoolIn) { }
888+
CCoinsViewMemPool::CCoinsViewMemPool(CCoinsView* baseIn, const CTxMemPool& mempoolIn) : CCoinsViewBacked(baseIn), mempool(mempoolIn) { }
889889

890890
bool CCoinsViewMemPool::GetCoins(const uint256 &txid, CCoins &coins) const {
891891
// If an entry in the mempool exists, always return that one, as it's guaranteed to never

src/txmempool.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -672,10 +672,10 @@ class CTxMemPool
672672
class CCoinsViewMemPool : public CCoinsViewBacked
673673
{
674674
protected:
675-
CTxMemPool &mempool;
675+
const CTxMemPool& mempool;
676676

677677
public:
678-
CCoinsViewMemPool(CCoinsView *baseIn, CTxMemPool &mempoolIn);
678+
CCoinsViewMemPool(CCoinsView* baseIn, const CTxMemPool& mempoolIn);
679679
bool GetCoins(const uint256 &txid, CCoins &coins) const;
680680
bool HaveCoins(const uint256 &txid) const;
681681
};

0 commit comments

Comments
 (0)