Checks whether the node has stopped. Returns True if the node has stopped. False otherwise. This method is responsible for freeing resources (self.process).
(self)
| 223 | del self.p2ps[:] |
| 224 | |
| 225 | def is_node_stopped(self): |
| 226 | """Checks whether the node has stopped. |
| 227 | |
| 228 | Returns True if the node has stopped. False otherwise. |
| 229 | This method is responsible for freeing resources (self.process).""" |
| 230 | if not self.running: |
| 231 | return True |
| 232 | return_code = self.process.poll() |
| 233 | if return_code is None: |
| 234 | return False |
| 235 | |
| 236 | # process has stopped. Assert that it didn't return an error code. |
| 237 | assert return_code == 0, self._node_msg( |
| 238 | "Node returned non-zero exit code (%d) when stopping" % return_code) |
| 239 | self.running = False |
| 240 | self.process = None |
| 241 | self.rpc_connected = False |
| 242 | self.rpc = None |
| 243 | self.log.debug("Node stopped") |
| 244 | return True |
| 245 | |
| 246 | def wait_until_stopped(self, timeout=BITCOIND_PROC_WAIT_TIMEOUT): |
| 247 | wait_until(self.is_node_stopped, timeout=timeout) |