This commit is contained in:
ThomasV 2017-10-04 09:24:34 +02:00
parent 91ed74a95f
commit 9f6e174b4f
2 changed files with 2 additions and 2 deletions

View File

@ -333,7 +333,6 @@ def script_to_p2wsh(script):
return hash_to_segwit_addr(sha256(bfh(script))) return hash_to_segwit_addr(sha256(bfh(script)))
def p2wpkh_nested_script(pubkey): def p2wpkh_nested_script(pubkey):
pubkey = safe_parse_pubkey(pubkey)
pkh = bh2u(hash_160(bfh(pubkey))) pkh = bh2u(hash_160(bfh(pubkey)))
return '00' + push_script(pkh) return '00' + push_script(pkh)

View File

@ -669,7 +669,8 @@ class Transaction:
elif _type in ['p2wpkh', 'p2wsh']: elif _type in ['p2wpkh', 'p2wsh']:
return '' return ''
elif _type == 'p2wpkh-p2sh': elif _type == 'p2wpkh-p2sh':
scriptSig = bitcoin.p2wpkh_nested_script(pubkeys[0]) pubkey = safe_parse_pubkey(pubkeys[0])
scriptSig = bitcoin.p2wpkh_nested_script(pubkey)
return push_script(scriptSig) return push_script(scriptSig)
elif _type == 'p2wsh-p2sh': elif _type == 'p2wsh-p2sh':
witness_script = self.get_preimage_script(txin) witness_script = self.get_preimage_script(txin)