mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02: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: ACK https://github.com/bitcoin/bitcoin/pull/23320/commits/059f88b6a97b7a3ae1f033885e40ac01f91e6d60 laanwj: re-ACK059f88b6a9Tree-SHA512: f27d53ac34b93a304ef5668701ed2b5c986a926bc8ad0df4de89695fc9e1df26acb008611451319ea897658acd9c56c6a0555d60359960c9cd28238ebefa2d50
This commit is contained in:
commit
66be456d93
3 changed files with 43 additions and 16 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue