do not show pubkeu in validateaddress if the key is imported
authorthomasv <thomasv@gitorious>
Sun, 15 Sep 2013 13:13:04 +0000 (15:13 +0200)
committerthomasv <thomasv@gitorious>
Sun, 15 Sep 2013 13:13:04 +0000 (15:13 +0200)
lib/commands.py

index 958393a..77f669e 100644 (file)
@@ -166,8 +166,9 @@ class Commands:
             out['address'] = addr
             out['ismine'] = is_mine
             if is_mine:
-                out['pubkey'] = self.wallet.get_public_key(addr)
-            
+                account, sequence = self.wallet.get_address_index(addr)
+                if account != -1:
+                    out['pubkey'] = self.wallet.get_public_key(addr)
         return out
 
     def getbalance(self, account= None):