From 83c6bc053a8f5a10c00bedb4c2c9d7acb9afdb8e Mon Sep 17 00:00:00 2001 From: Kristaps Kaupe Date: Fri, 8 Jul 2022 17:21:43 +0300 Subject: [PATCH] Allow bitcoin: prefix for addresses with sendpayment.py --- scripts/sendpayment.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/sendpayment.py b/scripts/sendpayment.py index 4cc3c9a..05ff401 100755 --- a/scripts/sendpayment.py +++ b/scripts/sendpayment.py @@ -96,6 +96,12 @@ def main(): sweeping = True destaddr = args[2] mixdepth = options.mixdepth + if btc.is_bip21_uri(args[2]): + parsed = btc.decode_bip21_uri(args[2]) + if 'amount' in parsed: + parser.error("Specify amount as a separate argument or amount in BIP21 URI, not both.") + sys.exit(EXIT_ARGERROR) + destaddr = parsed['address'] addr_valid, errormsg = validate_address(destaddr) command_to_burn = (is_burn_destination(destaddr) and sweeping and options.makercount == 0)