1
0

try to sweep p2pk outputs from old type WIF privkeys

This commit is contained in:
SomberNight
2017-10-25 15:14:55 +02:00
parent 06f18f9078
commit 1c31177d03
2 changed files with 29 additions and 15 deletions

View File

@@ -405,6 +405,9 @@ def address_to_script(addr):
def address_to_scripthash(addr):
script = address_to_script(addr)
return script_to_scripthash(script)
def script_to_scripthash(script):
h = sha256(bytes.fromhex(script))[0:32]
return bh2u(bytes(reversed(h)))