def load_mn_addresses_in_bip44_wallet(self, bip44_wallet: Bip44Wallet):
     addr_ids = []
     for mni in self.mn_items:
         if mni.masternode.collateral_address:
             a = bip44_wallet.get_address_item(mni.masternode.collateral_address, True)
             address_loc = Bip44AddressType(tree_id=None)
             address_loc.copy_from(a)
             if not address_loc.bip32_path:
                 address_loc.bip32_path = mni.masternode.collateral_bip32_path
                 a.bip32_path = mni.masternode.collateral_bip32_path
             mni.address = address_loc
             if mni.masternode.collateral_address not in addr_ids:
                 addr_ids.append(mni.address.id)
     if addr_ids:
         bip44_wallet.subscribe_addresses_for_chbalance(addr_ids, True)
Esempio n. 2
0
 def __init__(self, parent, masternode_list: List[MasternodeConfig],
              bip44_wallet: Bip44Wallet):
     ExtSortFilterTableModel.__init__(
         self, parent,
         [TableModelColumn('description', 'Description', True, 100)], False,
         False)
     self.mn_items: List[MnAddressItem] = []
     for mn in masternode_list:
         mni = MnAddressItem()
         mni.masternode = mn
         if mni.masternode.collateralAddress:
             a = bip44_wallet.get_address_item(
                 mni.masternode.collateralAddress, True)
             address_loc = Bip44AddressType(tree_id=None)
             address_loc.copy_from(a)
             if not address_loc.bip32_path:
                 address_loc.bip32_path = mni.masternode.collateralBip32Path
             mni.address = address_loc
             self.mn_items.append(mni)