Skip to content

Commit 2b1fdc2

Browse files
committed
refactor: minor styling, prefer snake case and same line if
1 parent d64deac commit 2b1fdc2

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

src/core_io.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ UniValue ValueFromAmount(const CAmount amount);
4444
std::string FormatScript(const CScript& script);
4545
std::string EncodeHexTx(const CTransaction& tx, const int serializeFlags = 0);
4646
std::string SighashToStr(unsigned char sighash_type);
47-
void ScriptPubKeyToUniv(const CScript& scriptPubKey, UniValue& out, bool fIncludeHex, bool include_address = true);
47+
void ScriptPubKeyToUniv(const CScript& scriptPubKey, UniValue& out, bool include_hex, bool include_address = true);
4848
void ScriptToUniv(const CScript& script, UniValue& out);
4949
void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry, bool include_hex = true, int serialize_flags = 0, const CTxUndo* txundo = nullptr);
5050

src/core_write.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,15 @@ std::string EncodeHexTx(const CTransaction& tx, const int serializeFlags)
143143

144144
void ScriptToUniv(const CScript& script, UniValue& out)
145145
{
146-
ScriptPubKeyToUniv(script, out, /* fIncludeHex */ true, /* include_address */ false);
146+
ScriptPubKeyToUniv(script, out, /* include_hex */ true, /* include_address */ false);
147147
}
148148

149-
void ScriptPubKeyToUniv(const CScript& scriptPubKey, UniValue& out, bool fIncludeHex, bool include_address)
149+
void ScriptPubKeyToUniv(const CScript& scriptPubKey, UniValue& out, bool include_hex, bool include_address)
150150
{
151151
CTxDestination address;
152152

153153
out.pushKV("asm", ScriptToAsmStr(scriptPubKey));
154-
if (fIncludeHex)
155-
out.pushKV("hex", HexStr(scriptPubKey));
154+
if (include_hex) out.pushKV("hex", HexStr(scriptPubKey));
156155

157156
std::vector<std::vector<unsigned char>> solns;
158157
const TxoutType type{Solver(scriptPubKey, solns)};

src/rpc/rawtransaction.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ static RPCHelpMan decodescript()
572572
} else {
573573
// Empty scripts are valid
574574
}
575-
ScriptPubKeyToUniv(script, r, /* fIncludeHex */ false);
575+
ScriptPubKeyToUniv(script, r, /* include_hex */ false);
576576

577577
UniValue type;
578578
type = find_value(r, "type");
@@ -606,7 +606,7 @@ static RPCHelpMan decodescript()
606606
// Newer segwit program versions should be considered when then become available.
607607
segwitScr = GetScriptForDestination(WitnessV0ScriptHash(script));
608608
}
609-
ScriptPubKeyToUniv(segwitScr, sr, /* fIncludeHex */ true);
609+
ScriptPubKeyToUniv(segwitScr, sr, /* include_hex */ true);
610610
sr.pushKV("p2sh-segwit", EncodeDestination(ScriptHash(segwitScr)));
611611
r.pushKV("segwit", sr);
612612
}
@@ -1161,7 +1161,7 @@ static RPCHelpMan decodepsbt()
11611161
txout = input.witness_utxo;
11621162

11631163
UniValue o(UniValue::VOBJ);
1164-
ScriptPubKeyToUniv(txout.scriptPubKey, o, /* fIncludeHex */ true);
1164+
ScriptPubKeyToUniv(txout.scriptPubKey, o, /* include_hex */ true);
11651165

11661166
UniValue out(UniValue::VOBJ);
11671167
out.pushKV("amount", ValueFromAmount(txout.nValue));

0 commit comments

Comments
 (0)