Skip to content

Commit 83acd1d

Browse files
committed
merge bitcoin#25887: avoid unsetting service bits from nLocalServices
1 parent 528795d commit 83acd1d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/init.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ namespace { // Variables internal to initialization process only
10411041
int nMaxConnections;
10421042
int nUserMaxConnections;
10431043
int nFD;
1044-
ServiceFlags nLocalServices = ServiceFlags(NODE_NETWORK | NODE_NETWORK_LIMITED | NODE_HEADERS_COMPRESSED);
1044+
ServiceFlags nLocalServices = ServiceFlags(NODE_NETWORK_LIMITED | NODE_HEADERS_COMPRESSED);
10451045
int64_t peer_connect_timeout;
10461046
std::set<BlockFilterType> g_enabled_filter_types;
10471047

@@ -2221,19 +2221,19 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
22212221
}
22222222
// ********************************************************* Step 10: data directory maintenance
22232223

2224-
2225-
// if pruning, unset the service bit and perform the initial blockstore prune
2224+
// if pruning, perform the initial blockstore prune
22262225
// after any wallet rescanning has taken place.
22272226
if (fPruneMode) {
2228-
LogPrintf("Unsetting NODE_NETWORK on prune mode\n");
2229-
nLocalServices = ServiceFlags(nLocalServices & ~NODE_NETWORK);
22302227
if (!fReindex) {
22312228
LOCK(cs_main);
22322229
for (CChainState* chainstate : chainman.GetAll()) {
22332230
uiInterface.InitMessage(_("Pruning blockstore…").translated);
22342231
chainstate->PruneAndFlush();
22352232
}
22362233
}
2234+
} else {
2235+
LogPrintf("Setting NODE_NETWORK on non-prune mode\n");
2236+
nLocalServices = ServiceFlags(nLocalServices | NODE_NETWORK);
22372237
}
22382238

22392239
// As PruneAndFlush can take several minutes, it's possible the user

0 commit comments

Comments
 (0)