1
0

check_scriptpubkey_template_and_dust: support anysegwit. fix #8012

This commit is contained in:
ThomasV
2022-10-12 10:06:56 +02:00
parent 34488478e6
commit 47c480be49

View File

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