예제 #1
0
파일: keystore.py 프로젝트: martyp11/PyB
 def __init__(self, d):
     Xpub.__init__(self)
     KeyStore.__init__(self)
     # Errors and other user interaction is done through the wallet's
     # handler.  The handler is per-window and preserved across
     # device reconnects
     self.xpub = d.get('xpub')
     self.label = d.get('label')
     self.derivation = d.get('derivation')
     self.handler = None
     run_hook('init_keystore', self)
예제 #2
0
    def run(self):
        run_hook('set_network', self)
        self.blockchain.init()
        while self.is_running():
            self.maintain_sockets()
            self.wait_on_sockets()
            self.handle_bc_requests()
            self.run_jobs()    # Synchronizer and Verifier
            self.process_pending_sends()

        self.stop_network()
        run_hook('set_network', None)
        self.print_error("stopped")
예제 #3
0
파일: util.py 프로젝트: GemHQ/electrum
 def resolve(self, k):
     if bitcoin.is_address(k):
         return {'address':k, 'type':'address'}
     if k in self.keys():
         _type, addr = self[k]
         if _type == 'address':
             return {'address':addr, 'type':'contact'}
     out = run_hook('resolve_address', k)
     if out:
         return out
     raise Exception("Invalid Bitcoin address or alias", k)
예제 #4
0
 def resolve(self, k, nocheck=False):
     if bitcoin.is_address(k):
         return {'address':k, 'type':'address'}
     if k in self.keys():
         _type, addr = self[k]
         if _type == 'address':
             return {'address':addr, 'type':'contact'}
     out = run_hook('resolve_address', k)
     if out:
         if not nocheck and out.get('validated') is False:
             raise Exception("cannot validate alias")
         return out
     raise Exception("invalid Litecoin address", k)
예제 #5
0
 def get_action(self):
     action = run_hook('get_action', self)
     if action:
         return action
     if not self.file_exists:
         return 'new'
예제 #6
0
 def get_action(self):
     action = run_hook('get_action', self)
     if action:
         return action
     if not self.file_exists:
         return 'new'