diff options
author | Rod Vagg <rod@vagg.org> | 2020-04-30 18:55:57 +1000 |
---|---|---|
committer | Rod Vagg <rod@vagg.org> | 2020-05-08 12:19:26 +1000 |
commit | 3e4421070af01374cd3daf77b28a2abc223c6f83 (patch) | |
tree | ce3e3dc3063c223a881a991c16123f0bc0fd319f | |
parent | f54753293fe7355e4280944d766f22054b560ba1 (diff) | |
download | bitcoin-3e4421070af01374cd3daf77b28a2abc223c6f83.tar.xz |
Expose txinwitness for coinbase in JSON form
txinwitness is used as the witness commitment nonce so is necessary if
reconstructing block data from RPC data.
-rw-r--r-- | src/core_write.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core_write.cpp b/src/core_write.cpp index cb1fc214eb..eb0cc35f06 100644 --- a/src/core_write.cpp +++ b/src/core_write.cpp @@ -198,13 +198,13 @@ void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry, o.pushKV("asm", ScriptToAsmStr(txin.scriptSig, true)); o.pushKV("hex", HexStr(txin.scriptSig.begin(), txin.scriptSig.end())); in.pushKV("scriptSig", o); - if (!tx.vin[i].scriptWitness.IsNull()) { - UniValue txinwitness(UniValue::VARR); - for (const auto& item : tx.vin[i].scriptWitness.stack) { - txinwitness.push_back(HexStr(item.begin(), item.end())); - } - in.pushKV("txinwitness", txinwitness); + } + if (!tx.vin[i].scriptWitness.IsNull()) { + UniValue txinwitness(UniValue::VARR); + for (const auto& item : tx.vin[i].scriptWitness.stack) { + txinwitness.push_back(HexStr(item.begin(), item.end())); } + in.pushKV("txinwitness", txinwitness); } in.pushKV("sequence", (int64_t)txin.nSequence); vin.push_back(in); |