diff options
author | fyquah <fyquah@protonmail.com> | 2021-03-01 20:03:35 +0000 |
---|---|---|
committer | Kiminuo <kiminuo@protonmail.com> | 2021-10-05 10:42:10 +0200 |
commit | 3cc95345ca49b87e8caca9a0e6418c63ae1e463a (patch) | |
tree | 67c4a41f26bdcdc1560edd40c5ec3945f530ec53 /src/rest.cpp | |
parent | 816e15ee81a2029cde6b4f9fe6fb93e75478c903 (diff) | |
download | bitcoin-3cc95345ca49b87e8caca9a0e6418c63ae1e463a.tar.xz |
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>
Diffstat (limited to 'src/rest.cpp')
-rw-r--r-- | src/rest.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/rest.cpp b/src/rest.cpp index e50ab33e54..d442a5e9fb 100644 --- a/src/rest.cpp +++ b/src/rest.cpp @@ -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 |