From 3cc95345ca49b87e8caca9a0e6418c63ae1e463a Mon Sep 17 00:00:00 2001 From: fyquah Date: Mon, 1 Mar 2021 20:03:35 +0000 Subject: rpc: Replace boolean argument for tx details with enum class. Co-authored-by: Luke Dashjr Co-authored-by: 0xB10C <19157360+0xB10C@users.noreply.github.com> --- src/rest.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/rest.cpp') 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 -- cgit v1.2.3 From 51dbc167e98daab317baa80cf80bfda337672dab Mon Sep 17 00:00:00 2001 From: fyquah Date: Sat, 27 Feb 2021 17:39:09 +0000 Subject: rpc: Add level 3 verbosity to getblock RPC call. Display the prevout in transaction inputs when calling getblock level 3 verbosity. Co-authored-by: Luke Dashjr Co-authored-by: 0xB10C <19157360+0xB10C@users.noreply.github.com> --- src/rest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/rest.cpp') diff --git a/src/rest.cpp b/src/rest.cpp index d442a5e9fb..e21fd8dad5 100644 --- a/src/rest.cpp +++ b/src/rest.cpp @@ -327,7 +327,7 @@ 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, TxVerbosity::SHOW_DETAILS); + return rest_block(context, req, strURIPart, TxVerbosity::SHOW_DETAILS_AND_PREVOUT); } static bool rest_block_notxdetails(const std::any& context, HTTPRequest* req, const std::string& strURIPart) -- cgit v1.2.3