Browse Source

Merge JoinMarket-Org/joinmarket-clientserver#1473: ignore txs with nonstandard sPKs when scanning

a94d87126e ignore txs with invalid sPKs when scanning (Adam Gibson)

Pull request description:

  Fixes #1471

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

Tree-SHA512: 1e1e52ba92aced6221f781a27083fe191992eb62232e1399e19bdf4890b0d12ac9faf6be1b3c6b074d56ae3039855f6f39cea656062ace78f848c170c56df912
master
Kristaps Kaupe 3 years ago
parent
commit
590a8f6e28
No known key found for this signature in database
GPG Key ID: 33E472FE870C7E5D
  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