Пример #1
0
    def on_receive(self):
        if self.wallet.use_encryption:
            password = self.win.password_dialog('An encrypted transaction was retrieved from cosigning pool.\nPlease enter your password to decrypt it.')
            if not password:
                return
        else:
            password = None
            if not self.win.question(_("An encrypted transaction was retrieved from cosigning pool.\nDo you want to open it now?")):
                return

        message = self.listener.message
        key = self.listener.keyname
        xprv = self.wallet.get_master_private_key(key, password)
        if not xprv:
            return
        try:
            k = bitcoin.deserialize_xkey(xprv)[-1].encode('hex')
            EC = bitcoin.EC_KEY(k.decode('hex'))
            message = EC.decrypt_message(message)
        except Exception as e:
            traceback.print_exc(file=sys.stdout)
            self.win.show_message(str(e))
            return

        self.listener.clear()
        tx = transaction.Transaction(message)
        show_transaction(tx, self.win, prompt_if_unsaved=True)
    def on_receive(self):
        if self.wallet.use_encryption:
            password = self.win.password_dialog(
                'An encrypted transaction was retrieved from cosigning pool.\nPlease enter your password to decrypt it.'
            )
            if not password:
                return
        else:
            password = None
            if not self.win.question(
                    _("An encrypted transaction was retrieved from cosigning pool.\nDo you want to open it now?"
                      )):
                return

        message = self.listener.message
        key = self.listener.keyname
        xprv = self.wallet.get_master_private_key(key, password)
        if not xprv:
            return
        try:
            k = bitcoin.deserialize_xkey(xprv)[-1].encode('hex')
            EC = bitcoin.EC_KEY(k.decode('hex'))
            message = EC.decrypt_message(message)
        except Exception as e:
            traceback.print_exc(file=sys.stdout)
            self.win.show_message(str(e))
            return

        self.listener.clear()
        tx = transaction.Transaction(message)
        show_transaction(tx, self.win, prompt_if_unsaved=True)
Пример #3
0
 def load_wallet(self, wallet, window):
     self.wallet = wallet
     if not self.is_available():
         return
     if self.listener is None:
         self.listener = Listener(self)
         self.listener.start()
     self.cosigner_list = []
     for key, xpub in self.wallet.master_public_keys.items():
         K = bitcoin.deserialize_xkey(xpub)[-1].encode('hex')
         _hash = bitcoin.Hash(K).encode('hex')
         if self.wallet.master_private_keys.get(key):
             self.listener.set_key(key, _hash)
         else:
             self.cosigner_list.append((xpub, K, _hash))
 def load_wallet(self, wallet, window):
     self.wallet = wallet
     if not self.is_available():
         return
     if self.listener is None:
         self.listener = Listener(self)
         self.listener.start()
     self.cosigner_list = []
     for key, xpub in self.wallet.master_public_keys.items():
         K = bitcoin.deserialize_xkey(xpub)[-1].encode('hex')
         _hash = bitcoin.Hash(K).encode('hex')
         if self.wallet.master_private_keys.get(key):
             self.listener.set_key(key, _hash)
         else:
             self.cosigner_list.append((xpub, K, _hash))