mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 15:19:07 +01:00
refactor: move verbosity parsing to rpc/util
Provides a common way for rpcs to obtain verbosity from an rpc parameter
This commit is contained in:
@@ -766,14 +766,7 @@ static RPCHelpMan getblock()
|
||||
{
|
||||
uint256 hash(ParseHashV(request.params[0], "blockhash"));
|
||||
|
||||
int verbosity = 1;
|
||||
if (!request.params[1].isNull()) {
|
||||
if (request.params[1].isBool()) {
|
||||
verbosity = request.params[1].get_bool() ? 1 : 0;
|
||||
} else {
|
||||
verbosity = request.params[1].getInt<int>();
|
||||
}
|
||||
}
|
||||
int verbosity{ParseVerbosity(request.params[1], /*default_verbosity=*/1)};
|
||||
|
||||
const CBlockIndex* pblockindex;
|
||||
const CBlockIndex* tip;
|
||||
|
||||
Reference in New Issue
Block a user