Skip to content

Commit 40c2700

Browse files
committed
merge bitcoin#20581: Don't make "in" parameters look like "out"/"in-out" parameters: pass by ref to const instead of ref to non-const
1 parent 1a2dbc8 commit 40c2700

File tree

10 files changed

+11
-11
lines changed

10 files changed

+11
-11
lines changed

src/init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1214,7 +1214,7 @@ std::set<BlockFilterType> g_enabled_filter_types;
12141214
std::terminate();
12151215
};
12161216

1217-
bool AppInitBasicSetup(ArgsManager& args)
1217+
bool AppInitBasicSetup(const ArgsManager& args)
12181218
{
12191219
// ********************************************************* Step 1: setup
12201220
#ifdef _MSC_VER

src/init.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void InitParameterInteraction(ArgsManager& args);
3333
* @note This can be done before daemonization. Do not call Shutdown() if this function fails.
3434
* @pre Parameters should be parsed and config file should be read.
3535
*/
36-
bool AppInitBasicSetup(ArgsManager& args);
36+
bool AppInitBasicSetup(const ArgsManager& args);
3737
/**
3838
* Initialization: parameter interaction.
3939
* @note This can be done before daemonization. Do not call Shutdown() if this function fails.

src/interfaces/wallet.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ WalletTx MakeWalletTx(CWallet& wallet, const CWalletTx& wtx)
7575
}
7676

7777
//! Construct wallet tx status struct.
78-
WalletTxStatus MakeWalletTxStatus(CWallet& wallet, const CWalletTx& wtx)
78+
WalletTxStatus MakeWalletTxStatus(const CWallet& wallet, const CWalletTx& wtx)
7979
{
8080
WalletTxStatus result;
8181
result.block_height = wallet.chain().getBlockHeight(wtx.m_confirm.hashBlock).value_or(std::numeric_limits<int>::max());
@@ -94,7 +94,7 @@ WalletTxStatus MakeWalletTxStatus(CWallet& wallet, const CWalletTx& wtx)
9494
}
9595

9696
//! Construct wallet TxOut struct.
97-
WalletTxOut MakeWalletTxOut(CWallet& wallet,
97+
WalletTxOut MakeWalletTxOut(const CWallet& wallet,
9898
const CWalletTx& wtx,
9999
int n,
100100
int depth) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet)

src/node/coinstats.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ bool GetUTXOStats(CCoinsView* view, CCoinsStats& stats, CoinStatsHashType hash_t
145145
}
146146

147147
// The legacy hash serializes the hashBlock
148-
static void PrepareHash(CHashWriter& ss, CCoinsStats& stats)
148+
static void PrepareHash(CHashWriter& ss, const CCoinsStats& stats)
149149
{
150150
ss << stats.hashBlock;
151151
}

src/rpc/rawtransaction_util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ void SignTransaction(CMutableTransaction& mtx, const SigningProvider* keystore,
205205
SignTransactionResultToJSON(mtx, complete, coins, input_errors, result);
206206
}
207207

208-
void SignTransactionResultToJSON(CMutableTransaction& mtx, bool complete, const std::map<COutPoint, Coin>& coins, std::map<int, std::string>& input_errors, UniValue& result)
208+
void SignTransactionResultToJSON(CMutableTransaction& mtx, bool complete, const std::map<COutPoint, Coin>& coins, const std::map<int, std::string>& input_errors, UniValue& result)
209209
{
210210
// Make errors UniValue
211211
UniValue vErrors(UniValue::VARR);

src/rpc/rawtransaction_util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class SigningProvider;
2525
* @param result JSON object where signed transaction results accumulate
2626
*/
2727
void SignTransaction(CMutableTransaction& mtx, const SigningProvider* keystore, const std::map<COutPoint, Coin>& coins, const UniValue& hashType, UniValue& result);
28-
void SignTransactionResultToJSON(CMutableTransaction& mtx, bool complete, const std::map<COutPoint, Coin>& coins, std::map<int, std::string>& input_errors, UniValue& result);
28+
void SignTransactionResultToJSON(CMutableTransaction& mtx, bool complete, const std::map<COutPoint, Coin>& coins, const std::map<int, std::string>& input_errors, UniValue& result);
2929

3030
/**
3131
* Parse a prevtxs UniValue array and get the map of coins from it

src/script/sigcache.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class CSignatureCache
5656
return setValid.contains(entry, erase);
5757
}
5858

59-
void Set(uint256& entry)
59+
void Set(const uint256& entry)
6060
{
6161
std::unique_lock<std::shared_mutex> lock(cs_sigcache);
6262
setValid.insert(entry);

src/test/addrman_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class CAddrManTest : public CAddrMan
6969
}
7070

7171
// Simulates connection failure so that we can test eviction of offline nodes
72-
void SimConnFail(CService& addr)
72+
void SimConnFail(const CService& addr)
7373
{
7474
LOCK(cs);
7575
int64_t nLastSuccess = 1;

src/test/net_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class CAddrManCorrupted : public CAddrManSerializationMock
7070
}
7171
};
7272

73-
static CDataStream AddrmanToStream(CAddrManSerializationMock& _addrman)
73+
static CDataStream AddrmanToStream(const CAddrManSerializationMock& _addrman)
7474
{
7575
CDataStream ssPeersIn(SER_DISK, CLIENT_VERSION);
7676
ssPeersIn << Params().MessageStart();

src/test/util_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1802,7 +1802,7 @@ BOOST_AUTO_TEST_CASE(test_Capitalize)
18021802
BOOST_CHECK_EQUAL(Capitalize("\x00\xfe\xff"), "\x00\xfe\xff");
18031803
}
18041804

1805-
static std::string SpanToStr(Span<const char>& span)
1805+
static std::string SpanToStr(const Span<const char>& span)
18061806
{
18071807
return std::string(span.begin(), span.end());
18081808
}

0 commit comments

Comments
 (0)