Skip to content

Commit

Permalink
Fix super linter issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
fchirica authored and hoffmang9 committed Jan 22, 2021
1 parent 252066d commit e80467f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 1 addition & 7 deletions src/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,13 +462,7 @@ async def get_peer_info(self) -> Optional[PeerInfo]:
def accept_inbound_connections(self, node_type: NodeType):
if not self._local_type == NodeType.FULL_NODE:
return True
inbound_count = len(
[
conn
for _, conn in self.connection_by_type[node_type].items()
if not conn.is_outbound
]
)
inbound_count = len([conn for _, conn in self.connection_by_type[node_type].items() if not conn.is_outbound])
if node_type == NodeType.FULL_NODE:
return inbound_count < self.config["target_peer_count"] - self.config["target_outbound_peer_count"]
if node_type == NodeType.WALLET:
Expand Down
2 changes: 2 additions & 0 deletions tests/core/full_node/test_full_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,13 @@ async def wallet_nodes():
async for _ in async_gen:
yield _


@pytest.fixture(scope="function")
async def setup_five_nodes():
async for _ in setup_simulators_and_wallets(5, 0, {}):
yield _


class TestFullNodeProtocol:
@pytest.mark.asyncio
async def test_inbound_connection_limit(self, setup_five_nodes):
Expand Down

0 comments on commit e80467f

Please sign in to comment.