diff --git a/src/validation.cpp b/src/validation.cpp --- a/src/validation.cpp +++ b/src/validation.cpp @@ -2510,6 +2510,11 @@ InvalidChainFound(pindexNew); } + const bool fAvalancheEnabled = + gArgs.GetBoolArg("-enableavalanche", AVALANCHE_DEFAULT_ENABLED); + const bool fAutoUnpark = + gArgs.GetBoolArg("-automaticunparking", !fAvalancheEnabled); + const CBlockIndex *pindexFork = m_chain.FindFork(pindexNew); // Check whether all blocks on the path between the currently active @@ -2523,7 +2528,7 @@ // If this is a parked chain, but it has enough PoW, clear the park // state. bool fParkedChain = pindexTest->nStatus.isOnParkedChain(); - if (fParkedChain && gArgs.GetBoolArg("-automaticunparking", true)) { + if (fAutoUnpark && fParkedChain) { const CBlockIndex *pindexTip = m_chain.Tip(); // During initialization, pindexTip and/or pindexFork may be @@ -2630,8 +2635,7 @@ } } - if (g_avalanche && - gArgs.GetBoolArg("-enableavalanche", AVALANCHE_DEFAULT_ENABLED)) { + if (fAvalancheEnabled && g_avalanche) { g_avalanche->addBlockToReconcile(pindexNew); } diff --git a/test/functional/abc_p2p_avalanche.py b/test/functional/abc_p2p_avalanche.py --- a/test/functional/abc_p2p_avalanche.py +++ b/test/functional/abc_p2p_avalanche.py @@ -84,7 +84,7 @@ self.setup_clean_chain = True self.num_nodes = 2 self.extra_args = [ - ['-enableavalanche=1', '-avacooldown=0', '-automaticunparking=0'], + ['-enableavalanche=1', '-avacooldown=0'], ['-enableavalanche=1', '-avacooldown=0', '-noparkdeepreorg', '-maxreorgdepth=-1']] self.supports_cli = False