From 0f5ab4c296b1f709890b73962c91ff09357f4788 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Sun, 11 Jan 2015 20:37:08 +0100 Subject: [PATCH] add ismine command. should fix issue #975 --- lib/commands.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/commands.py b/lib/commands.py index 62f920cd..9f2d2229 100644 --- a/lib/commands.py +++ b/lib/commands.py @@ -84,6 +84,7 @@ register_command('getmpk', 0, 0, False, True, False, 'Return your register_command('help', 0, 1, False, False, False, 'Prints this help') register_command('history', 0, 0, True, True, False, 'Returns the transaction history of your wallet') register_command('importprivkey', 1, 1, False, True, True, 'Import a private key', 'importprivkey ') +register_command('ismine', 1, 1, False, True, False, 'Return true if and only if address is in wallet', 'ismine ) register_command('listaddresses', 2, 2, False, True, False, 'Returns your list of addresses.', '', listaddr_options) register_command('listunspent', 0, 0, True, True, False, 'Returns the list of unspent inputs in your wallet.') register_command('getaddressunspent', 1, 1, True, False, False, 'Returns the list of unspent inputs for an address.') @@ -208,6 +209,9 @@ class Commands: def getprivatekeys(self, addr): return self.wallet.get_private_key(addr, self.password) + def ismine(self, addr): + return self.wallet.is_mine(addr) + def dumpprivkeys(self, addresses = None): if addresses is None: addresses = self.wallet.addresses(True)