Skip to content

Commit

Permalink
Merge branch 'fix/scripPk_to_hash' of https://github.com/wakumo/count…
Browse files Browse the repository at this point in the history
  • Loading branch information
chiguireitor committed Dec 19, 2020
2 parents adcc183 + 59350bf commit 41b447b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ profile.txt

# Cache folders
.cache

.python-version
8 changes: 3 additions & 5 deletions counterpartylib/lib/backend/addrindexrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import binascii
import hashlib
import signal
import bitcoin.wallet

from counterpartylib.lib import config, util, address

Expand Down Expand Up @@ -358,11 +359,8 @@ def _script_pubkey_to_hash(spk):
return hashlib.sha256(spk).digest()[::-1].hex()

def _address_to_hash(addr):
pk = address.address_scriptpubkey(addr)
#if pk[0:3] == b'\x76\xa9\x14':
# pk = b''.join([pk[0:3], pk[4:-6], pk[-2:]])

return _script_pubkey_to_hash(pk)
script_pubkey = bitcoin.wallet.CBitcoinAddress(addr).to_scriptPubKey()
return _script_pubkey_to_hash(script_pubkey)

# Returns an array of UTXOS from an address in the following format
# {
Expand Down

0 comments on commit 41b447b

Please sign in to comment.