aboutsummaryrefslogtreecommitdiff
path: root/src/core_write.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2017-08-21 08:42:11 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2017-08-21 08:58:08 +0200
commit820ddd48a752c98a1c80e9d09c184026499f6463 (patch)
tree38de609ff4dc38984981523676deb061eaae8921 /src/core_write.cpp
parenta8532299d8b9dd835813c6c444433ee6955245ac (diff)
parent6bbdafcdc4f9d9e3f9de72ed686c060fb4b8b465 (diff)
Merge #11027: [RPC] Only return hex field once in getrawtransaction
6bbdafc Pass serialization flags and whether to include hex to TxToUniv (Andrew Chow) e029c6e Only return hex field once in getrawtransaction (Andrew Chow) Pull request description: The hex is already returned in `TxToUniv()`, no need to give it out a second time in getrawtransaction itself. Tree-SHA512: 270289f2d6dea37f51f5a42db3dae5debdbe83c6b504fccfd3391588da986ed474592c6655d522dc51022d4b08fa90ed1ebb249afe036309f95adfe3652cb262
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 0eae4703ab..1431fa0c9b 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".
+ }
}