mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 06:52:36 +01:00
Address review comments from #22918
* fix English in release notes * Simplify `switch` to `if`.
This commit is contained in:
parent
0ccf9b2e55
commit
1bdd5f6322
3 changed files with 11 additions and 15 deletions
|
@ -82,7 +82,7 @@ Updated RPCs
|
|||
`gettransaction verbose=true` and REST endpoints `/rest/tx`, `/rest/getutxos`,
|
||||
`/rest/block` no longer return the `addresses` and `reqSigs` fields, which
|
||||
were previously deprecated in 22.0. (#22650)
|
||||
- The `getblock` RPC command now supports verbose level 3 containing transaction inputs
|
||||
- The `getblock` RPC command now supports verbosity level 3 containing transaction inputs'
|
||||
`prevout` information. The existing `/rest/block/` REST endpoint is modified to contain
|
||||
this information too. Every `vin` field will contain an additional `prevout` subfield
|
||||
describing the spent output. `prevout` contains the following keys:
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -229,6 +229,7 @@ UniValue blockToJSON(const CBlock& block, const CBlockIndex* tip, const CBlockIn
|
|||
TxToUniv(*tx, uint256(), objTx, true, RPCSerializationFlags(), txundo, verbosity);
|
||||
txs.push_back(objTx);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
result.pushKV("tx", txs);
|
||||
|
|
Loading…
Add table
Reference in a new issue