1414#include < kernel/mempool_persist.h>
1515#include < kernel/validation_cache_sizes.h>
1616
17+ #include < addrdb.h>
1718#include < addrman.h>
1819#include < banman.h>
1920#include < blockfilter.h>
@@ -342,7 +343,7 @@ void Shutdown(NodeContext& node)
342343 chainstate->ResetCoinsViews ();
343344 }
344345 }
345- pblocktree. reset ();
346+ // pblocktree removed in v26.2 - now managed by BlockManager
346347 }
347348 for (const auto & client : node.chain_clients ) {
348349 client->stop ();
@@ -875,8 +876,6 @@ bool AppInitBasicSetup(const ArgsManager& args, std::atomic<int>& exit_status)
875876 if (!args.GetBoolArg (" -sysperms" , false )) {
876877 umask (077 );
877878 }
878-
879- #ifndef WIN32
880879 // Clean shutdown on SIGTERM
881880 registerSignalHandler (SIGTERM , HandleSIGTERM);
882881 registerSignalHandler (SIGINT , HandleSIGTERM);
@@ -1064,13 +1063,13 @@ bool AppInitParameterInteraction(const ArgsManager& args)
10641063 if (nPruneArg == 1 ) { // manual pruning: -prune=1
10651064 LogPrintf (" Block pruning enabled. Use RPC call pruneblockchain(height) to manually prune block and undo files.\n " );
10661065 nPruneTarget = std::numeric_limits<uint64_t >::max ();
1067- fPruneMode = true ;
1066+ // fPruneMode is set via BlockManager options in v26.2
10681067 } else if (nPruneTarget) {
10691068 if (nPruneTarget < MIN_DISK_SPACE_FOR_BLOCK_FILES ) {
10701069 return InitError (strprintf (_ (" Prune configured below the minimum of %d MiB. Please use a higher number." ), MIN_DISK_SPACE_FOR_BLOCK_FILES / 1024 / 1024 ));
10711070 }
10721071 LogPrintf (" Prune configured to target %u MiB on disk for block and undo files.\n " , nPruneTarget / 1024 / 1024 );
1073- fPruneMode = true ;
1072+ // fPruneMode is set via BlockManager options in v26.2
10741073 }
10751074
10761075 nConnectTimeout = args.GetIntArg (" -timeout" , DEFAULT_CONNECT_TIMEOUT );
@@ -1123,8 +1122,9 @@ bool AppInitParameterInteraction(const ArgsManager& args)
11231122 if (!chainman_result) {
11241123 return InitError (util::ErrorString (chainman_result));
11251124 }
1126- BlockManager::Options blockman_opts_dummy{
1125+ node:: BlockManager::Options blockman_opts_dummy{
11271126 .chainparams = chainman_opts_dummy.chainparams ,
1127+ .prune_target = nPruneTarget,
11281128 .blocks_dir = args.GetBlocksDirPath (),
11291129 .notifications = chainman_opts_dummy.notifications ,
11301130 };
@@ -1371,11 +1371,20 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
13711371 // Initialize mempool
13721372 assert (!node.mempool );
13731373 int check_ratio = std::min<int >(std::max<int >(args.GetIntArg (" -checkmempool" , chainparams.DefaultConsistencyChecks () ? 1 : 0 ), 0 ), 1000000 );
1374- node.mempool = std::make_unique<CTxMemPool>(node.fee_estimator .get (), check_ratio);
1374+
1375+ CTxMemPool::Options mempool_opts{
1376+ .estimator = node.fee_estimator .get (),
1377+ .check_ratio = check_ratio,
1378+ };
1379+ node.mempool = std::make_unique<CTxMemPool>(mempool_opts);
13751380
13761381 // Initialize DigiByte stempool for Dandelion++ privacy protocol
13771382 assert (!node.stempool );
1378- node.stempool = std::make_unique<CTxMemPool>(nullptr , 0 , true );
1383+ CTxMemPool::Options stempool_opts{
1384+ .estimator = nullptr ,
1385+ .check_ratio = 0 ,
1386+ };
1387+ node.stempool = std::make_unique<CTxMemPool>(stempool_opts);
13791388
13801389 // Check port numbers
13811390 for (const std::string port_option : {
@@ -1539,7 +1548,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
15391548
15401549 // Read asmap file if configured
15411550 if (args.IsArgSet (" -asmap" )) {
1542- fs::path asmap_path = fs::path (args.GetArg (" -asmap" , " " ));
1551+ fs::path asmap_path = fs::PathFromString (args.GetArg (" -asmap" , " " ));
15431552 if (asmap_path.empty ()) {
15441553 asmap_path = DEFAULT_ASMAP_FILENAME ;
15451554 }
@@ -1550,13 +1559,13 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
15501559 InitError (strprintf (_ (" Could not find asmap file %s" ), asmap_path));
15511560 return false ;
15521561 }
1553- std::vector<bool > asmap = CAddrMan:: DecodeAsmap (asmap_path);
1562+ std::vector<bool > asmap = DecodeAsmap (asmap_path);
15541563 if (asmap.size () == 0 ) {
15551564 InitError (strprintf (_ (" Could not parse asmap file %s" ), asmap_path));
15561565 return false ;
15571566 }
1558- const uint256 asmap_version = SerializeHash ( asmap);
1559- node. connman -> SetAsmap ( std::move ( asmap));
1567+ const uint256 asmap_version = (HashWriter{} << asmap). GetHash ( );
1568+ // asmap is now passed via netgroupman in v26.2
15601569 LogPrintf (" Using asmap version %s for IP bucketing\n " , asmap_version.ToString ());
15611570 } else {
15621571 LogPrintf (" Using /16 prefix for IP bucketing\n " );
@@ -1588,8 +1597,9 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
15881597 };
15891598 Assert (ApplyArgsManOptions (args, chainman_opts)); // no error can happen, already checked in AppInitParameterInteraction
15901599
1591- BlockManager::Options blockman_opts{
1600+ node:: BlockManager::Options blockman_opts{
15921601 .chainparams = chainman_opts.chainparams ,
1602+ .prune_target = nPruneTarget,
15931603 .blocks_dir = args.GetBlocksDirPath (),
15941604 .notifications = chainman_opts.notifications ,
15951605 };
@@ -1729,7 +1739,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
17291739 assert (!node.peerman );
17301740 node.peerman = PeerManager::make (*node.connman , *node.addrman ,
17311741 node.banman .get (), chainman,
1732- *node.mempool , peerman_opts);
1742+ *node.mempool , *node. stempool , peerman_opts);
17331743 RegisterValidationInterface (node.peerman .get ());
17341744
17351745 // ********************************************************* Step 8: start indexers
0 commit comments