fix bug with has_seed
authorThomasV <thomasv@gitorious>
Wed, 30 Apr 2014 13:44:46 +0000 (15:44 +0200)
committerThomasV <thomasv@gitorious>
Wed, 30 Apr 2014 13:44:46 +0000 (15:44 +0200)
lib/bitcoin.py
lib/wallet.py

index 44174d2..328d1fd 100644 (file)
@@ -299,7 +299,11 @@ def is_address(addr):
 
 
 def is_private_key(key):
-    return ASecretToSecret(key) is not False
+    try:
+        k = ASecretToSecret(key) 
+        return k is not False
+    except:
+        return False
 
 
 ########### end pywallet functions #######################
index 6e963c4..46736c9 100644 (file)
@@ -1126,10 +1126,10 @@ class Deterministic_Wallet(Abstract_Wallet):
         Abstract_Wallet.__init__(self, storage)
 
     def has_seed(self):
-        return self.seed == ''
+        return self.seed != ''
 
     def is_watching_only(self):
-        return self.has_seed()
+        return not self.has_seed()
 
     def check_password(self, password):
         self.get_seed(password)