Example #1
0
 def register_address(self, scan: bool = False) -> None:
     """Register this network's address with it's bitcoin node to watch for UTXOs
     Args:
         scan: Boolean whether or not to scan the blockchain for existing UTXOs
             This is necessary if the address that's being imported already has funds. This can take a long time (10+ minutes)
     Raises:
         exceptions.AddressRegistrationFailure: When the bitcoin node failed to register the address
     """
     registered = self._call("listlabels")
     if self.address not in registered:
         response = self._call("importaddress", self.address, self.address, scan)
         # Note: False on import address prevents scanning for existing utxos. If the wallet already exists with funds,
         # this needs to be True instead of False, which can take a long time (10+ minutes) to run
         if response:  # Returns null on success
             raise exceptions.AddressRegistrationFailure("Address failed registering")
Example #2
0
 def register_address(self) -> None:
     registered = self.call("listlabels")
     if self.interchain_address not in registered:
         response = self.call("importaddress", self.interchain_address, self.interchain_address, False)
         if response:
             raise exceptions.AddressRegistrationFailure("Address failed registering")