File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ class ChainstateManager;
17
17
/* * Whether transaction reconciliation protocol should be enabled by default. */
18
18
static constexpr bool DEFAULT_TXRECONCILIATION_ENABLE{false };
19
19
/* * Default for -maxorphantx, maximum number of orphan transactions kept in memory */
20
- static const unsigned int DEFAULT_MAX_ORPHAN_TRANSACTIONS = 100 ;
20
+ static const uint32_t DEFAULT_MAX_ORPHAN_TRANSACTIONS{ 100 } ;
21
21
/* * Default number of non-mempool transactions to keep around for block reconstruction. Includes
22
22
orphan, replaced, and rejected transactions. */
23
23
static const unsigned int DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN = 100 ;
Original file line number Diff line number Diff line change 3
3
#include < common/args.h>
4
4
#include < net_processing.h>
5
5
6
+ #include < algorithm>
7
+ #include < limits>
8
+
6
9
namespace node {
7
10
8
11
void ApplyArgsManOptions (const ArgsManager& argsman, PeerManager::Options& options)
9
12
{
10
13
if (auto value{argsman.GetBoolArg (" -txreconciliation" )}) options.reconcile_txs = *value;
11
14
12
15
if (auto value{argsman.GetIntArg (" -maxorphantx" )}) {
13
- options.max_orphan_txs = uint32_t (std::max ( int64_t { 0 }, *value ));
16
+ options.max_orphan_txs = uint32_t (( std::clamp< int64_t >(*value, 0 , std::numeric_limits< uint32_t >:: max ()) ));
14
17
}
15
18
16
19
if (auto value{argsman.GetIntArg (" -blockreconstructionextratxn" )}) {
You can’t perform that action at this time.
0 commit comments