1
0
This commit is contained in:
ThomasV
2016-12-21 13:30:35 +01:00
parent a660590a70
commit cda0d14a13
2 changed files with 31 additions and 7 deletions

View File

@@ -384,6 +384,15 @@ def is_address(addr):
return False
return addr == hash_160_to_bc_address(h, addrtype)
def is_p2pkh(addr):
if is_address(addr):
addrtype, h = bc_address_to_hash_160(addr)
return addrtype in [0]
def is_p2sh(addr):
if is_address(addr):
addrtype, h = bc_address_to_hash_160(addr)
return addrtype in [5]
def is_private_key(key):
try: