mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
Merge bitcoin/bitcoin#23320: rpc: Add RPC help for getblock verbosity level 3
059f88b6a9Add RPC help for getblock verbosity level 3 (Kiminuo)1bdd5f6322Address review comments from #22918 (Kiminuo) Pull request description: This is a follow-up PR to #22918 which addresses review comments (first commit). The second commit adds missing RPC help for verbosity level 3. ACKs for top commit: pg156: ACK059f88b6a9laanwj: re-ACK059f88b6a9Tree-SHA512: f27d53ac34b93a304ef5668701ed2b5c986a926bc8ad0df4de89695fc9e1df26acb008611451319ea897658acd9c56c6a0555d60359960c9cd28238ebefa2d50
This commit is contained in:
@@ -208,22 +208,17 @@ void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry,
|
||||
const CTxOut& prev_txout = prev_coin.out;
|
||||
|
||||
amt_total_in += prev_txout.nValue;
|
||||
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));
|
||||
p.pushKV("value", ValueFromAmount(prev_txout.nValue));
|
||||
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));
|
||||
p.pushKV("value", ValueFromAmount(prev_txout.nValue));
|
||||
p.pushKV("scriptPubKey", o_script_pub_key);
|
||||
in.pushKV("prevout", p);
|
||||
}
|
||||
}
|
||||
in.pushKV("sequence", (int64_t)txin.nSequence);
|
||||
|
||||
Reference in New Issue
Block a user