diff --git a/basicswap/basicswap.py b/basicswap/basicswap.py index a08cbe8..2c27b18 100644 --- a/basicswap/basicswap.py +++ b/basicswap/basicswap.py @@ -3965,7 +3965,7 @@ class BasicSwap(BaseApp, BSXNetwork, UIApp): def isValidSwapDest(self, ci, dest: bytes): ensure(isinstance(dest, bytes), "Swap destination must be bytes") if ci.coin_type() in (Coins.PART_BLIND,): - return ci.isValidPubkey(dest) + return ci.verifyPubkey(dest) # TODO: allow p2wsh return ci.isValidAddressHash(dest) @@ -10905,7 +10905,7 @@ class BasicSwap(BaseApp, BSXNetwork, UIApp): ) ensure( ci_from.isValidAddressHash(bid_data.dest_af) - or ci_from.isValidPubkey(bid_data.dest_af), + or ci_from.verifyPubkey(bid_data.dest_af), "Invalid destination address", ) diff --git a/basicswap/interface/base.py b/basicswap/interface/base.py index 295e9d7..9ed10ef 100644 --- a/basicswap/interface/base.py +++ b/basicswap/interface/base.py @@ -220,12 +220,6 @@ class Secp256k1Interface(CoinInterface, AdaptorSigInterface): if hash_len == 20: return True - def isValidPubkey(self, pubkey: bytes) -> bool: - try: - return self.verifyPubkey(pubkey) - except Exception: - return False - def verifySig(self, pubkey: bytes, signed_hash: bytes, sig: bytes) -> bool: pubkey = PublicKey(pubkey) return pubkey.verify(sig, signed_hash, hasher=None)