Browse Source

ignore txs with invalid sPKs when scanning

master
Adam Gibson 3 years ago
parent
commit
a94d87126e
No known key found for this signature in database
GPG Key ID: 141001A1AF77F20B
  1. 8
      jmbitcoin/jmbitcoin/snicker.py

8
jmbitcoin/jmbitcoin/snicker.py

@ -9,6 +9,7 @@ from jmbitcoin.secp256k1_transaction import *
from collections import Counter
from bitcointx.core.key import CKey, CPubKey
from bitcointx.wallet import CCoinAddressError
SNICKER_MAGIC_BYTES = b'SNICKER'
@ -154,8 +155,11 @@ def is_snicker_v1_tx(tx):
for vo in tx.vout:
if vo.nValue == equal_out:
if not matched_spk:
matched_spk = btc.CCoinAddress.from_scriptPubKey(
vo.scriptPubKey).get_scriptPubKey_type()
try:
matched_spk = btc.CCoinAddress.from_scriptPubKey(
vo.scriptPubKey).get_scriptPubKey_type()
except CCoinAddressError:
return False
else:
if not btc.CCoinAddress.from_scriptPubKey(
vo.scriptPubKey).get_scriptPubKey_type() == matched_spk:

Loading…
Cancel
Save