Browse Source

Implemented getunusedaddress command

The implementation of the getunusedaddress will directly query
the wallet for the first unused address
283
Guido Diepen 8 years ago
parent
commit
e6f4af9fd5
  1. 13
      lib/commands.py

13
lib/commands.py

@ -563,6 +563,19 @@ class Commands:
out = filter(lambda x: x.get('status')==f, out)
return map(self._format_request, out)
@command('w')
def getunusedaddress(self,force=False):
"""Returns the first unused address."""
addr = self.wallet.get_unused_address()
if addr is None and force:
addr = self.wallet.create_new_address(False)
if addr:
return addr
else:
return False
@command('w')
def addrequest(self, amount, memo='', expiration=None, force=False):
"""Create a payment request."""

Loading…
Cancel
Save