Skip to content

Commit 7cc39b1

Browse files
author
MarcoFalke
committed
Merge bitcoin/bitcoin#24347: rpc: Fix implicit-integer-sign-change in verifychain
fa8dad0 rpc: Fix implicit-integer-sign-change in verifychain (MarcoFalke) Pull request description: It doesn't really make sense to treat `DEFAULT_CHECKLEVEL` as unsigned as long as `VerifyDB` accepts a signed integer. Making it signed also avoids a cast round trip from signed->unsigned->signed in the RPC. ACKs for top commit: luke-jr: utACK fa8dad0 theStack: Code-review ACK fa8dad0 Tree-SHA512: 75499dbe4ace2962792e5fbec7defb10c25fdbbfde951d5e542a91daa880cc50395da0287173e2c84a28e18267c74af7b44b9f38ce364bcb0216c402f65b7641
2 parents 5f44c5c + fa8dad0 commit 7cc39b1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/rpc/blockchain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1417,7 +1417,7 @@ static RPCHelpMan verifychain()
14171417
},
14181418
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
14191419
{
1420-
const int check_level(request.params[0].isNull() ? DEFAULT_CHECKLEVEL : request.params[0].get_int());
1420+
const int check_level{request.params[0].isNull() ? DEFAULT_CHECKLEVEL : request.params[0].get_int()};
14211421
const int check_depth{request.params[1].isNull() ? DEFAULT_CHECKBLOCKS : request.params[1].get_int()};
14221422

14231423
ChainstateManager& chainman = EnsureAnyChainman(request.context);

src/validation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static const int DEFAULT_STOPATHEIGHT = 0;
9090
/** Block files containing a block-height within MIN_BLOCKS_TO_KEEP of ActiveChain().Tip() will not be pruned. */
9191
static const unsigned int MIN_BLOCKS_TO_KEEP = 288;
9292
static const signed int DEFAULT_CHECKBLOCKS = 6;
93-
static const unsigned int DEFAULT_CHECKLEVEL = 3;
93+
static constexpr int DEFAULT_CHECKLEVEL{3};
9494
// Require that user allocate at least 550 MiB for block & undo files (blk???.dat and rev???.dat)
9595
// At 1MB per block, 288 blocks = 288MB.
9696
// Add 15% for Undo data = 331MB

0 commit comments

Comments
 (0)