Skip to content

Commit

Permalink
Merge #1473: ignore txs with nonstandard sPKs when scanning
Browse files Browse the repository at this point in the history
a94d871 ignore txs with invalid sPKs when scanning (Adam Gibson)

Pull request description:

  Fixes #1471

ACKs for top commit:
  openoms:
    tACK [a94d871](a94d871)
  kristapsk:
    cr utACK a94d871

Tree-SHA512: 1e1e52ba92aced6221f781a27083fe191992eb62232e1399e19bdf4890b0d12ac9faf6be1b3c6b074d56ae3039855f6f39cea656062ace78f848c170c56df912
  • Loading branch information
kristapsk committed Apr 12, 2023
2 parents b8e99bb + a94d871 commit 590a8f6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions jmbitcoin/jmbitcoin/snicker.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from collections import Counter

from bitcointx.core.key import CKey, CPubKey
from bitcointx.wallet import CCoinAddressError

SNICKER_MAGIC_BYTES = b'SNICKER'

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 590a8f6

Please sign in to comment.