A style we are already using in some RPC code. i.e:
https://github.com/bitcoin/bitcoin/blob/55ea6fd2506b84f553c0bd42f48a9cc4393bab47/src/rpc/blockchain.cpp#L864-L866
More concise (about half the lines of code).
Variables that should be made const, can be made const.
I'd argue that this:
const bool fVerbose{request.params[0].isNull() ? false : request.params[0].get_bool()};
const bool include_mempool_sequence{request.params[1].isNull() ? false : request.params[1].get_bool()};
is easier to read / reason about, than:
bool fVerbose = false;
if (!request.params[0].isNull())
fVerbose = request.params[0].get_bool();
bool include_mempool_sequence = false;
if (!request.params[1].isNull()) {
include_mempool_sequence = request.params[1].get_bool();
}