diff --git a/src/init.cpp b/src/init.cpp --- a/src/init.cpp +++ b/src/init.cpp @@ -2433,6 +2433,9 @@ // Step 6.5 (I guess ?): Initialize Avalanche. g_avalanche = std::make_unique( *node.chain, node.connman.get(), node.peerman.get()); + if (args.GetBoolArg("-enableavalanche", AVALANCHE_DEFAULT_ENABLED)) { + nLocalServices = ServiceFlags(nLocalServices | NODE_AVALANCHE); + } // Step 7: load block chain 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 @@ -126,6 +126,11 @@ def run_test(self): node = self.nodes[0] + self.log.info("Check the node is signalling the avalanche service.") + assert_equal( + int(node.getnetworkinfo()['localservices'], 16) & NODE_AVALANCHE, + NODE_AVALANCHE) + # Build a fake quorum of nodes. def get_quorum(): def get_node():