Browse Source

check_scriptpubkey_template_and_dust: support anysegwit. fix #8012

patch-4
ThomasV 2 years ago
parent
commit
47c480be49
  1. 2
      electrum/transaction.py

2
electrum/transaction.py

@ -476,6 +476,8 @@ def check_scriptpubkey_template_and_dust(scriptpubkey, amount: Optional[int]):
dust_limit = bitcoin.DUST_LIMIT_P2WSH dust_limit = bitcoin.DUST_LIMIT_P2WSH
elif match_script_against_template(scriptpubkey, SCRIPTPUBKEY_TEMPLATE_P2WPKH): elif match_script_against_template(scriptpubkey, SCRIPTPUBKEY_TEMPLATE_P2WPKH):
dust_limit = bitcoin.DUST_LIMIT_P2WPKH dust_limit = bitcoin.DUST_LIMIT_P2WPKH
elif match_script_against_template(scriptpubkey, SCRIPTPUBKEY_TEMPLATE_ANYSEGWIT):
dust_limit = bitcoin.DUST_LIMIT_UNKNOWN_SEGWIT
else: else:
raise Exception(f'scriptpubkey does not conform to any template: {scriptpubkey.hex()}') raise Exception(f'scriptpubkey does not conform to any template: {scriptpubkey.hex()}')
if amount < dust_limit: if amount < dust_limit:

Loading…
Cancel
Save