aboutsummaryrefslogtreecommitdiff
path: root/src/core_write.cpp
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2017-08-11 12:21:14 -0700
committerAndrew Chow <achow101-github@achow101.com>2017-08-17 10:42:51 -0700
commit6bbdafcdc4f9d9e3f9de72ed686c060fb4b8b465 (patch)
tree2a3cabde520fbe74bde9f434f4a1d724840c73f8 /src/core_write.cpp
parente029c6e709d251809aa04edc08f76a077a2443e7 (diff)
downloadbitcoin-6bbdafcdc4f9d9e3f9de72ed686c060fb4b8b465.tar.xz
Pass serialization flags and whether to include hex to TxToUniv
Diffstat (limited to 'src/core_write.cpp')
-rw-r--r--src/core_write.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core_write.cpp b/src/core_write.cpp
index 217b491a0d..c32b1ca227 100644
--- a/src/core_write.cpp
+++ b/src/core_write.cpp
@@ -153,7 +153,7 @@ void ScriptPubKeyToUniv(const CScript& scriptPubKey,
out.pushKV("addresses", a);
}
-void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry)
+void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry, bool include_hex, int serialize_flags)
{
entry.pushKV("txid", tx.GetHash().GetHex());
entry.pushKV("hash", tx.GetWitnessHash().GetHex());
@@ -207,5 +207,7 @@ void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry)
if (!hashBlock.IsNull())
entry.pushKV("blockhash", hashBlock.GetHex());
- entry.pushKV("hex", EncodeHexTx(tx)); // the hex-encoded transaction. used the name "hex" to be consistent with the verbose output of "getrawtransaction".
+ 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".
+ }
}