mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-05 14:06:27 -05: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`,
|
`gettransaction verbose=true` and REST endpoints `/rest/tx`, `/rest/getutxos`,
|
||||||
`/rest/block` no longer return the `addresses` and `reqSigs` fields, which
|
`/rest/block` no longer return the `addresses` and `reqSigs` fields, which
|
||||||
were previously deprecated in 22.0. (#22650)
|
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
|
`prevout` information. The existing `/rest/block/` REST endpoint is modified to contain
|
||||||
this information too. Every `vin` field will contain an additional `prevout` subfield
|
this information too. Every `vin` field will contain an additional `prevout` subfield
|
||||||
describing the spent output. `prevout` contains the following keys:
|
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;
|
const CTxOut& prev_txout = prev_coin.out;
|
||||||
|
|
||||||
amt_total_in += prev_txout.nValue;
|
amt_total_in += prev_txout.nValue;
|
||||||
switch (verbosity) {
|
|
||||||
case TxVerbosity::SHOW_TXID:
|
|
||||||
case TxVerbosity::SHOW_DETAILS:
|
|
||||||
break;
|
|
||||||
|
|
||||||
case TxVerbosity::SHOW_DETAILS_AND_PREVOUT:
|
if (verbosity == TxVerbosity::SHOW_DETAILS_AND_PREVOUT) {
|
||||||
UniValue o_script_pub_key(UniValue::VOBJ);
|
UniValue o_script_pub_key(UniValue::VOBJ);
|
||||||
ScriptPubKeyToUniv(prev_txout.scriptPubKey, o_script_pub_key, /* includeHex */ true);
|
ScriptPubKeyToUniv(prev_txout.scriptPubKey, o_script_pub_key, /*include_hex=*/ true);
|
||||||
|
|
||||||
UniValue p(UniValue::VOBJ);
|
UniValue p(UniValue::VOBJ);
|
||||||
p.pushKV("generated", bool(prev_coin.fCoinBase));
|
p.pushKV("generated", bool(prev_coin.fCoinBase));
|
||||||
p.pushKV("height", uint64_t(prev_coin.nHeight));
|
p.pushKV("height", uint64_t(prev_coin.nHeight));
|
||||||
p.pushKV("value", ValueFromAmount(prev_txout.nValue));
|
p.pushKV("value", ValueFromAmount(prev_txout.nValue));
|
||||||
p.pushKV("scriptPubKey", o_script_pub_key);
|
p.pushKV("scriptPubKey", o_script_pub_key);
|
||||||
in.pushKV("prevout", p);
|
in.pushKV("prevout", p);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
in.pushKV("sequence", (int64_t)txin.nSequence);
|
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);
|
TxToUniv(*tx, uint256(), objTx, true, RPCSerializationFlags(), txundo, verbosity);
|
||||||
txs.push_back(objTx);
|
txs.push_back(objTx);
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
result.pushKV("tx", txs);
|
result.pushKV("tx", txs);
|
||||||
|
|
Loading…
Add table
Reference in a new issue