def do_send(self, tx): for xpub, K, _hash in self.cosigner_list: if not self.cosigner_can_sign(tx, xpub): continue message = bitcoin.encrypt_message(tx.raw, K) try: server.put(_hash, message) except Exception as e: self.win.show_message(str(e)) return self.win.show_message("Your transaction was sent to the cosigning pool.\nOpen your cosigner wallet to retrieve it.")
def do_send(self, tx): for window, xpub, K, _hash in self.cosigner_list: if not self.cosigner_can_sign(tx, xpub): continue message = bitcoin.encrypt_message(bfh(tx.raw), bh2u(K)).decode('ascii') try: server.put(_hash, message) except Exception as e: traceback.print_exc(file=sys.stdout) window.show_message("Failed to send transaction to cosigning pool.") return window.show_message("Your transaction was sent to the cosigning pool.\nOpen your cosigner wallet to retrieve it.")
def doEncrypt(self) -> None: message = self.topTvDel.text message = message.encode('utf-8') pubkey = self.tf.text.strip() encryptedTVDel = self.botTvDel if not pubkey: parent().show_message( _("Please provide a public key or select an address")) return try: encrypted = bitcoin.encrypt_message(message, pubkey) encryptedTVDel.text = str(encrypted.decode('ascii')) except BaseException as e: traceback.print_exc(file=sys.stdout) parent().show_error(str(e))
def do_send(self, tx): for window, xpub, K, _hash in self.cosigner_list: if not self.cosigner_can_sign(tx, xpub): continue raw_tx_bytes = bfh(str(tx)) message = bitcoin.encrypt_message(raw_tx_bytes, bh2u(K)).decode('ascii') try: server.put(_hash, message) except Exception as e: traceback.print_exc(file=sys.stdout) window.show_error( _("Failed to send transaction to cosigning pool") + ':\n' + str(e)) return window.show_message( _("Your transaction was sent to the cosigning pool.") + '\n' + _("Open your cosigner wallet to retrieve it."))