mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-27 16:05:39 +01:00
refactor: Make const refs vars where applicable
This avoids initializing variables with the copy-constructor of a non-trivially copyable type.
This commit is contained in:
@@ -159,14 +159,14 @@ static void TxInErrorToJSON(const CTxIn& txin, UniValue& vErrorsRet, const std::
|
||||
void ParsePrevouts(const UniValue& prevTxsUnival, FillableSigningProvider* keystore, std::map<COutPoint, Coin>& coins)
|
||||
{
|
||||
if (!prevTxsUnival.isNull()) {
|
||||
UniValue prevTxs = prevTxsUnival.get_array();
|
||||
const UniValue& prevTxs = prevTxsUnival.get_array();
|
||||
for (unsigned int idx = 0; idx < prevTxs.size(); ++idx) {
|
||||
const UniValue& p = prevTxs[idx];
|
||||
if (!p.isObject()) {
|
||||
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "expected object with {\"txid'\",\"vout\",\"scriptPubKey\"}");
|
||||
}
|
||||
|
||||
UniValue prevOut = p.get_obj();
|
||||
const UniValue& prevOut = p.get_obj();
|
||||
|
||||
RPCTypeCheckObj(prevOut,
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user