md = hashlib.new('ripemd160')
md.update(hashlib.sha256(public_key).digest())
return md.digest()
- except:
+ except Exception:
import ripemd
md = ripemd.new(hashlib.sha256(public_key).digest())
return md.digest()
if not ADDRESS_RE.match(addr): return False
try:
addrtype, h = bc_address_to_hash_160(addr)
- except:
+ except Exception:
return False
return addr == hash_160_to_bc_address(h, addrtype)
try:
from ecdsa.ecdsa import curve_secp256k1, generator_secp256k1
-except:
+except Exception:
print "cannot import ecdsa.curve_secp256k1. You probably need to upgrade ecdsa.\nTry: sudo pip install --upgrade ecdsa"
exit()
from ecdsa.curves import SECP256k1
try:
self.verify_message( address, sig, message)
return sig
- except:
+ except Exception:
continue
else:
raise Exception("error: cannot sign message")