Ejemplo n.º 1
0
    def update_status_lnd(self):
        if IS_WIN32_ENV:
            return

        # log.debug("update_status_lnd due: {}".format(self.status_lnd_due))
        if self.status_lnd_due <= self.uptime:
            log.debug("updating status_lnd")
            stub_readonly = ReadOnlyStub(network=self.rb_cfg.network, chain=self.rb_cfg.chain)
            pid_ok, listen_ok, unlocked, synced_to_chain, synced_to_graph = check_lnd(stub_readonly)
            self.status_lnd_pid_ok = pid_ok
            self.status_lnd_listen_ok = listen_ok
            self.status_lnd_unlocked = unlocked
            self.status_lnd_synced_to_chain = synced_to_chain
            self.status_lnd_synced_to_graph = synced_to_graph
            # set next due time
            self.status_lnd_due = self.uptime + self.status_lnd_interval
Ejemplo n.º 2
0
    def update_status_lnd(self):

        if IS_WIN32_ENV:
            return

        if self.status_lnd_due <= self.uptime:
            log.debug("updating status_lnd")

            try:
                with ReadOnlyStub(network=self.rb_cfg.network.value, chain=self.rb_cfg.chain.value) as stub_readonly:
                    pid_ok, listen_ok, unlocked, synced_to_chain, synced_to_graph = check_lnd(stub_readonly)
                    self.status_lnd_pid_ok = pid_ok
                    self.status_lnd_listen_ok = listen_ok
                    self.status_lnd_unlocked = unlocked
                    self.status_lnd_synced_to_chain = synced_to_chain
                    self.status_lnd_synced_to_graph = synced_to_graph
                    # set next due time
                    self.status_lnd_due = self.uptime + self.status_lnd_interval
            except Exception as err:
                log.info("Exception on update_status_lnd")
                pass