diff --git a/pyasic/network/__init__.py b/pyasic/network/__init__.py index d8781d13..e7a00f71 100644 --- a/pyasic/network/__init__.py +++ b/pyasic/network/__init__.py @@ -48,6 +48,7 @@ class MinerNetwork: if mask.startswith("/"): mask = mask.replace("/", "") self.mask = mask + self.network = self.get_network() def __len__(self): return len([item for item in self.get_network().hosts()]) @@ -55,6 +56,10 @@ class MinerNetwork: def __repr__(self): return str(self.network) + def hosts(self): + for x in self.network.hosts(): + yield x + def get_network(self) -> ipaddress.ip_network: """Get the network using the information passed to the MinerNetwork or from cache.