Merge pull request #10381 from f321x/donation_address_remove_prefix
interface: remove prefix from donation addresses
This commit is contained in:
@@ -1560,12 +1560,15 @@ class Interface(Logger):
|
||||
# check response
|
||||
if not res: # ignore empty string
|
||||
return ''
|
||||
if not bitcoin.is_address(res):
|
||||
if not isinstance(res, str):
|
||||
raise RequestCorrupted(f'{res!r} should be a str')
|
||||
address = res.removeprefix('bitcoin:')
|
||||
if not bitcoin.is_address(address):
|
||||
# note: do not hard-fail -- allow server to use future-type
|
||||
# bitcoin address we do not recognize
|
||||
self.logger.info(f"invalid donation address from server: {repr(res)}")
|
||||
res = ''
|
||||
return res
|
||||
return ''
|
||||
return address
|
||||
|
||||
async def get_relay_fee(self) -> int:
|
||||
"""Returns the min relay feerate in sat/kbyte."""
|
||||
|
||||
Reference in New Issue
Block a user