aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Dietz <michael.dietz@waya.ai>2021-09-29 09:58:36 -0500
committerfanquake <fanquake@gmail.com>2022-03-30 20:00:27 +0100
commit22f25a61168f261dff06fb66737be55eab290c5b (patch)
treeb82acfcc3cefbef077aaf31376c78c3165f83252
parent828a094ecfbf93ad9e4bb83b85a519f7416ff3fb (diff)
downloadbitcoin-22f25a61168f261dff06fb66737be55eab290c5b.tar.xz
refactor: prefer snake case, TxToUniv arg hashBlock renamed block_hash
-rw-r--r--src/core_io.h2
-rw-r--r--src/core_write.cpp7
2 files changed, 5 insertions, 4 deletions
diff --git a/src/core_io.h b/src/core_io.h
index 9bdbd7c17f..aa1381c374 100644
--- a/src/core_io.h
+++ b/src/core_io.h
@@ -54,6 +54,6 @@ std::string FormatScript(const CScript& script);
std::string EncodeHexTx(const CTransaction& tx, const int serializeFlags = 0);
std::string SighashToStr(unsigned char sighash_type);
void ScriptToUniv(const CScript& script, UniValue& out, bool include_hex = true, bool include_address = false);
-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);
+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);
#endif // BITCOIN_CORE_IO_H
diff --git a/src/core_write.cpp b/src/core_write.cpp
index fc4d1da7be..1fce4c5214 100644
--- a/src/core_write.cpp
+++ b/src/core_write.cpp
@@ -164,7 +164,7 @@ void ScriptToUniv(const CScript& script, UniValue& out, bool include_hex, bool i
out.pushKV("type", GetTxnOutputType(type));
}
-void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry, bool include_hex, int serialize_flags, const CTxUndo* txundo, TxVerbosity verbosity)
+void TxToUniv(const CTransaction& tx, const uint256& block_hash, UniValue& entry, bool include_hex, int serialize_flags, const CTxUndo* txundo, TxVerbosity verbosity)
{
entry.pushKV("txid", tx.GetHash().GetHex());
entry.pushKV("hash", tx.GetWitnessHash().GetHex());
@@ -253,8 +253,9 @@ void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry,
entry.pushKV("fee", ValueFromAmount(fee));
}
- if (!hashBlock.IsNull())
- entry.pushKV("blockhash", hashBlock.GetHex());
+ if (!block_hash.IsNull()) {
+ entry.pushKV("blockhash", block_hash.GetHex());
+ }
if (include_hex) {
entry.pushKV("hex", EncodeHexTx(tx, serialize_flags)); // The hex-encoded transaction. Used the name "hex" to be consistent with the verbose output of "getrawtransaction".