def check_invoice(self, flag, tick=0): log.info("checking invoice paid (Tick: {})".format(tick)) self.invoice_to_check_flag = flag if tick >= INVOICE_CHECK_TIMEOUT: log.debug("canceled checking invoice paid") flag.set() if IS_DEV_ENV: res = False amt_paid_sat = 123123402 if tick == 5: res = True else: stub_readonly = ReadOnlyStub(network=self.rb_cfg.network, chain=self.rb_cfg.chain) res, amt_paid_sat = check_invoice_paid(stub_readonly, self.invoice_to_check) log.debug("result of invoice check: {}".format(res)) if res: log.debug("paid!") self.ui_qr_code.qcode.setMargin(8) self.ui_qr_code.qcode.setPixmap(QPixmap(":/RaspiBlitz/images/Paid_Stamp.png")) if amt_paid_sat: self.ui_qr_code.status_value.setText("Paid") self.ui_qr_code.amt_paid_value.setText("{}".format(amt_paid_sat)) else: self.ui_qr_code.status_value.setText("Paid") flag.set()
def get_node_uri(self): if IS_DEV_ENV: return "535f209faaea75427949e3e6c1fc9edafbf751f08706506bb873fdc93ffc2d4e2c@pqcjuc47eqcv6mk2.onion:9735" stub_readonly = ReadOnlyStub(network=self.rb_cfg.network, chain=self.rb_cfg.chain) res = get_node_uri(stub_readonly) log.info("Node URI: : {}".format(res)) return res
def update_status_lnd_channels(self): if IS_WIN32_ENV: return # log.debug("update_status_lnd_channel due: {}".format(self.status_lnd_channel_due)) if self.status_lnd_channel_due <= self.uptime: log.debug("updating status_lnd_channels") stub_readonly = ReadOnlyStub(network=self.rb_cfg.network, chain=self.rb_cfg.chain) self.status_lnd_channel_total_active, self.status_lnd_channel_total_remote_balance = \ check_lnd_channels(stub_readonly) # set next due time self.status_lnd_channel_due = self.uptime + self.status_lnd_channel_interval
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
def update_status_lnd_channels(self): if IS_WIN32_ENV: return log.debug("update_status_lnd_channel due: {}".format(self.status_lnd_channel_due)) if self.status_lnd_channel_due <= self.uptime: log.debug("updating status_lnd_channels") try: with ReadOnlyStub(network=self.rb_cfg.network.value, chain=self.rb_cfg.chain.value) as stub_readonly: self.status_lnd_channel_total_active, self.status_lnd_channel_total_remote_balance = \ check_lnd_channels(stub_readonly) # set next due time self.status_lnd_channel_due = self.uptime + self.status_lnd_channel_interval except Exception as err: log.info("Exception on update_status_lnd_channels") pass
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