Skip to content

Commit 22f25a6

Browse files
mjdietzxfanquake
authored andcommitted
refactor: prefer snake case, TxToUniv arg hashBlock renamed block_hash
1 parent 828a094 commit 22f25a6

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/core_io.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ std::string FormatScript(const CScript& script);
5454
std::string EncodeHexTx(const CTransaction& tx, const int serializeFlags = 0);
5555
std::string SighashToStr(unsigned char sighash_type);
5656
void ScriptToUniv(const CScript& script, UniValue& out, bool include_hex = true, bool include_address = false);
57-
void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry, bool include_hex = true, int serialize_flags = 0, const CTxUndo* txundo = nullptr, TxVerbosity verbosity = TxVerbosity::SHOW_DETAILS);
57+
void TxToUniv(const CTransaction& tx, const uint256& block_hash, UniValue& entry, bool include_hex = true, int serialize_flags = 0, const CTxUndo* txundo = nullptr, TxVerbosity verbosity = TxVerbosity::SHOW_DETAILS);
5858

5959
#endif // BITCOIN_CORE_IO_H

src/core_write.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ void ScriptToUniv(const CScript& script, UniValue& out, bool include_hex, bool i
164164
out.pushKV("type", GetTxnOutputType(type));
165165
}
166166

167-
void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry, bool include_hex, int serialize_flags, const CTxUndo* txundo, TxVerbosity verbosity)
167+
void TxToUniv(const CTransaction& tx, const uint256& block_hash, UniValue& entry, bool include_hex, int serialize_flags, const CTxUndo* txundo, TxVerbosity verbosity)
168168
{
169169
entry.pushKV("txid", tx.GetHash().GetHex());
170170
entry.pushKV("hash", tx.GetWitnessHash().GetHex());
@@ -253,8 +253,9 @@ void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry,
253253
entry.pushKV("fee", ValueFromAmount(fee));
254254
}
255255

256-
if (!hashBlock.IsNull())
257-
entry.pushKV("blockhash", hashBlock.GetHex());
256+
if (!block_hash.IsNull()) {
257+
entry.pushKV("blockhash", block_hash.GetHex());
258+
}
258259

259260
if (include_hex) {
260261
entry.pushKV("hex", EncodeHexTx(tx, serialize_flags)); // The hex-encoded transaction. Used the name "hex" to be consistent with the verbose output of "getrawtransaction".

0 commit comments

Comments
 (0)