commit 68bfce07c119fb91c8ef707a958c9e6987a30399
parent 6b5a2b98d2a2640cb202573c234f7dc473dd55d9
Author: ThomasV <thomasv@gitorious>
Date: Sun, 15 Jan 2012 21:22:51 +0100
fix is_valid
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/client/electrum.py b/client/electrum.py
@@ -399,7 +399,10 @@ class Wallet:
def is_valid(self,addr):
ADDRESS_RE = re.compile('[1-9A-HJ-NP-Za-km-z]{26,}\\Z')
if not ADDRESS_RE.match(addr): return False
- h = bc_address_to_hash_160(addr)
+ try:
+ h = bc_address_to_hash_160(addr)
+ except:
+ return False
return addr == hash_160_to_bc_address(h)
def stretch_key(self,seed):