1
0

Merge pull request #3125 from SomberNight/sweep_p2pk

try to sweep p2pk outputs from old type WIF privkeys
This commit is contained in:
ThomasV
2017-10-27 21:01:56 +02:00
committed by GitHub
2 changed files with 29 additions and 15 deletions

View File

@@ -411,6 +411,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)))