From abbffefda035118488000720c9d315b139a33e70 Mon Sep 17 00:00:00 2001 From: openoms Date: Sun, 16 Apr 2023 12:13:55 +0100 Subject: [PATCH] ignore matched txs with invalid sPKs when scanning --- jmbitcoin/jmbitcoin/snicker.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/jmbitcoin/jmbitcoin/snicker.py b/jmbitcoin/jmbitcoin/snicker.py index 745731ee2..91fb5761d 100644 --- a/jmbitcoin/jmbitcoin/snicker.py +++ b/jmbitcoin/jmbitcoin/snicker.py @@ -161,8 +161,11 @@ def is_snicker_v1_tx(tx): except CCoinAddressError: return False else: - if not btc.CCoinAddress.from_scriptPubKey( - vo.scriptPubKey).get_scriptPubKey_type() == matched_spk: + try: + if not btc.CCoinAddress.from_scriptPubKey( + vo.scriptPubKey).get_scriptPubKey_type() == matched_spk: + return False + except CCoinAddressError: return False assert matched_spk return True