mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-23 07:52:46 +02:00
rpc: Replace boolean argument for tx details with enum class.
Co-authored-by: Luke Dashjr <luke_github1@dashjr.org> Co-authored-by: 0xB10C <19157360+0xB10C@users.noreply.github.com>
This commit is contained in:
@@ -260,7 +260,7 @@ static bool rest_headers(const std::any& context,
|
||||
static bool rest_block(const std::any& context,
|
||||
HTTPRequest* req,
|
||||
const std::string& strURIPart,
|
||||
bool showTxDetails)
|
||||
TxVerbosity tx_verbosity)
|
||||
{
|
||||
if (!CheckWarmup(req))
|
||||
return false;
|
||||
@@ -312,7 +312,7 @@ static bool rest_block(const std::any& context,
|
||||
}
|
||||
|
||||
case RetFormat::JSON: {
|
||||
UniValue objBlock = blockToJSON(block, tip, pblockindex, showTxDetails);
|
||||
UniValue objBlock = blockToJSON(block, tip, pblockindex, tx_verbosity);
|
||||
std::string strJSON = objBlock.write() + "\n";
|
||||
req->WriteHeader("Content-Type", "application/json");
|
||||
req->WriteReply(HTTP_OK, strJSON);
|
||||
@@ -327,12 +327,12 @@ static bool rest_block(const std::any& context,
|
||||
|
||||
static bool rest_block_extended(const std::any& context, HTTPRequest* req, const std::string& strURIPart)
|
||||
{
|
||||
return rest_block(context, req, strURIPart, true);
|
||||
return rest_block(context, req, strURIPart, TxVerbosity::SHOW_DETAILS);
|
||||
}
|
||||
|
||||
static bool rest_block_notxdetails(const std::any& context, HTTPRequest* req, const std::string& strURIPart)
|
||||
{
|
||||
return rest_block(context, req, strURIPart, false);
|
||||
return rest_block(context, req, strURIPart, TxVerbosity::SHOW_TXID);
|
||||
}
|
||||
|
||||
// A bit of a hack - dependency on a function defined in rpc/blockchain.cpp
|
||||
|
Reference in New Issue
Block a user