Closed reinamora137 closed 8 months ago
blocks.py debug:
try:
source = CBitcoinAddress.from_taproot_scriptPubKey(prev_vout_script_pubkey)
Transaction: 8f842c7fcb165902a3ef8e7e2b888ede6277c15e3a5c1e9fb92ccbfd0bc303f6
this should have been resolved with the addition of this function:
def decode_address(script_pubkey):
try:
# Attempt standard address decoding
address = CBitcoinAddress.from_scriptPubKey(script_pubkey)
return str(address)
except Exception as e:
# Handle other types of addresses
if len(script_pubkey) == 34 and script_pubkey[0] == 0x51: # Taproot check
# Extract the witness program for Taproot
witness_program = script_pubkey[2:]
# Decode as Bech32m address
return pubkeyhash_to_addr(witness_program, prefix='bc', encoding='bech32', witver=1)
else:
raise ValueError("Unsupported scriptPubKey format")
final testing in progress to confirm.
this was resolved in the new function to decode addresses