Merge 66be456d93 into merged_master (Bitcoin PR bitcoin/bitcoin#23320)

This commit is contained in:
Byron Hambly 2023-06-15 04:56:56 +00:00
commit 3ce9952451
3 changed files with 47 additions and 20 deletions

View file

@ -259,26 +259,21 @@ void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry,
const Coin& prev_coin = txundo->vprevout[i];
const CTxOut& prev_txout = prev_coin.out;
switch (verbosity) {
case TxVerbosity::SHOW_TXID:
case TxVerbosity::SHOW_DETAILS:
break;
case TxVerbosity::SHOW_DETAILS_AND_PREVOUT:
UniValue o_script_pub_key(UniValue::VOBJ);
ScriptPubKeyToUniv(prev_txout.scriptPubKey, o_script_pub_key, /* includeHex */ true);
if (verbosity == TxVerbosity::SHOW_DETAILS_AND_PREVOUT) {
UniValue o_script_pub_key(UniValue::VOBJ);
ScriptPubKeyToUniv(prev_txout.scriptPubKey, o_script_pub_key, /*include_hex=*/ true);
UniValue p(UniValue::VOBJ);
p.pushKV("generated", bool(prev_coin.fCoinBase));
p.pushKV("height", uint64_t(prev_coin.nHeight));
if (prev_txout.nValue.IsExplicit()) {
p.pushKV("value", ValueFromAmount(prev_txout.nValue.GetAmount()));
} else {
p.pushKV("value", "<confidential>");
}
p.pushKV("scriptPubKey", o_script_pub_key);
in.pushKV("prevout", p);
break;
UniValue p(UniValue::VOBJ);
p.pushKV("generated", bool(prev_coin.fCoinBase));
p.pushKV("height", uint64_t(prev_coin.nHeight));
if (prev_txout.nValue.IsExplicit()) {
p.pushKV("value", ValueFromAmount(prev_txout.nValue.GetAmount()));
} else {
p.pushKV("value", "<confidential>");
}
p.pushKV("scriptPubKey", o_script_pub_key);
in.pushKV("prevout", p);
}
}
in.pushKV("sequence", (int64_t)txin.nSequence);