def _make_node_path(self, xpub, address_n): _, depth, fingerprint, child_num, chain_code, key = deserialize_xpub(xpub) node = HDNodeType( depth=depth, fingerprint=int.from_bytes(fingerprint, 'big'), child_num=int.from_bytes(child_num, 'big'), chain_code=chain_code, public_key=key, ) return HDNodePathType(node=node, address_n=address_n)
def update(self, window): wallet = window.wallet state = window.cosigner_pool_state if not state: self.print_error("No cosigner pool state object for window", window.diagnostic_name()) return listener = state.listener state.keys = [] state.cosigner_list = [] for key, keystore in wallet.keystores.items(): xpub = keystore.get_master_public_key() K = bitcoin.deserialize_xpub(xpub)[-1] _hash = bh2u(bitcoin.Hash(K)) if not keystore.is_watching_only(): state.keys.append((key, _hash)) else: state.cosigner_list.append((xpub, K, _hash)) listener.set_keyhashes([t[1] for t in state.keys]) if not listener.is_running(): self.print_error("Starting listener for", window.diagnostic_name()) listener.start()
def update(self, window): wallet = window.wallet if type(wallet) != Multisig_Wallet: return if self.listener is None: self.print_error("starting listener") self.listener = Listener(self) self.listener.start() elif self.listener: self.print_error("shutting down listener") self.listener.stop() self.listener = None self.keys = [] self.cosigner_list = [] for key, keystore in wallet.keystores.items(): xpub = keystore.get_master_public_key() K = bitcoin.deserialize_xpub(xpub)[-1].encode('hex') _hash = bitcoin.Hash(K).encode('hex') if not keystore.is_watching_only(): self.keys.append((key, _hash, window)) else: self.cosigner_list.append((window, xpub, K, _hash)) if self.listener: self.listener.set_keyhashes([t[1] for t in self.keys])