mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
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
This commit is contained in:
parent
1a2dbc81c5
commit
40c270030e
@ -1214,7 +1214,7 @@ std::set<BlockFilterType> g_enabled_filter_types;
|
||||
std::terminate();
|
||||
};
|
||||
|
||||
bool AppInitBasicSetup(ArgsManager& args)
|
||||
bool AppInitBasicSetup(const ArgsManager& args)
|
||||
{
|
||||
// ********************************************************* Step 1: setup
|
||||
#ifdef _MSC_VER
|
||||
|
@ -33,7 +33,7 @@ void InitParameterInteraction(ArgsManager& args);
|
||||
* @note This can be done before daemonization. Do not call Shutdown() if this function fails.
|
||||
* @pre Parameters should be parsed and config file should be read.
|
||||
*/
|
||||
bool AppInitBasicSetup(ArgsManager& args);
|
||||
bool AppInitBasicSetup(const ArgsManager& args);
|
||||
/**
|
||||
* Initialization: parameter interaction.
|
||||
* @note This can be done before daemonization. Do not call Shutdown() if this function fails.
|
||||
|
@ -75,7 +75,7 @@ WalletTx MakeWalletTx(CWallet& wallet, const CWalletTx& wtx)
|
||||
}
|
||||
|
||||
//! Construct wallet tx status struct.
|
||||
WalletTxStatus MakeWalletTxStatus(CWallet& wallet, const CWalletTx& wtx)
|
||||
WalletTxStatus MakeWalletTxStatus(const CWallet& wallet, const CWalletTx& wtx)
|
||||
{
|
||||
WalletTxStatus result;
|
||||
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)
|
||||
}
|
||||
|
||||
//! Construct wallet TxOut struct.
|
||||
WalletTxOut MakeWalletTxOut(CWallet& wallet,
|
||||
WalletTxOut MakeWalletTxOut(const CWallet& wallet,
|
||||
const CWalletTx& wtx,
|
||||
int n,
|
||||
int depth) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet)
|
||||
|
@ -145,7 +145,7 @@ bool GetUTXOStats(CCoinsView* view, CCoinsStats& stats, CoinStatsHashType hash_t
|
||||
}
|
||||
|
||||
// The legacy hash serializes the hashBlock
|
||||
static void PrepareHash(CHashWriter& ss, CCoinsStats& stats)
|
||||
static void PrepareHash(CHashWriter& ss, const CCoinsStats& stats)
|
||||
{
|
||||
ss << stats.hashBlock;
|
||||
}
|
||||
|
@ -205,7 +205,7 @@ void SignTransaction(CMutableTransaction& mtx, const SigningProvider* keystore,
|
||||
SignTransactionResultToJSON(mtx, complete, coins, input_errors, result);
|
||||
}
|
||||
|
||||
void SignTransactionResultToJSON(CMutableTransaction& mtx, bool complete, const std::map<COutPoint, Coin>& coins, std::map<int, std::string>& input_errors, UniValue& result)
|
||||
void SignTransactionResultToJSON(CMutableTransaction& mtx, bool complete, const std::map<COutPoint, Coin>& coins, const std::map<int, std::string>& input_errors, UniValue& result)
|
||||
{
|
||||
// Make errors UniValue
|
||||
UniValue vErrors(UniValue::VARR);
|
||||
|
@ -25,7 +25,7 @@ class SigningProvider;
|
||||
* @param result JSON object where signed transaction results accumulate
|
||||
*/
|
||||
void SignTransaction(CMutableTransaction& mtx, const SigningProvider* keystore, const std::map<COutPoint, Coin>& coins, const UniValue& hashType, UniValue& result);
|
||||
void SignTransactionResultToJSON(CMutableTransaction& mtx, bool complete, const std::map<COutPoint, Coin>& coins, std::map<int, std::string>& input_errors, UniValue& result);
|
||||
void SignTransactionResultToJSON(CMutableTransaction& mtx, bool complete, const std::map<COutPoint, Coin>& coins, const std::map<int, std::string>& input_errors, UniValue& result);
|
||||
|
||||
/**
|
||||
* Parse a prevtxs UniValue array and get the map of coins from it
|
||||
|
@ -56,7 +56,7 @@ public:
|
||||
return setValid.contains(entry, erase);
|
||||
}
|
||||
|
||||
void Set(uint256& entry)
|
||||
void Set(const uint256& entry)
|
||||
{
|
||||
std::unique_lock<std::shared_mutex> lock(cs_sigcache);
|
||||
setValid.insert(entry);
|
||||
|
@ -69,7 +69,7 @@ public:
|
||||
}
|
||||
|
||||
// Simulates connection failure so that we can test eviction of offline nodes
|
||||
void SimConnFail(CService& addr)
|
||||
void SimConnFail(const CService& addr)
|
||||
{
|
||||
LOCK(cs);
|
||||
int64_t nLastSuccess = 1;
|
||||
|
@ -70,7 +70,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
static CDataStream AddrmanToStream(CAddrManSerializationMock& _addrman)
|
||||
static CDataStream AddrmanToStream(const CAddrManSerializationMock& _addrman)
|
||||
{
|
||||
CDataStream ssPeersIn(SER_DISK, CLIENT_VERSION);
|
||||
ssPeersIn << Params().MessageStart();
|
||||
|
@ -1802,7 +1802,7 @@ BOOST_AUTO_TEST_CASE(test_Capitalize)
|
||||
BOOST_CHECK_EQUAL(Capitalize("\x00\xfe\xff"), "\x00\xfe\xff");
|
||||
}
|
||||
|
||||
static std::string SpanToStr(Span<const char>& span)
|
||||
static std::string SpanToStr(const Span<const char>& span)
|
||||
{
|
||||
return std::string(span.begin(), span.end());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user