From 6656154b780a5d2c8adc2a7695e9912fad16db68 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Wed, 11 Oct 2017 12:07:41 +0200 Subject: [PATCH] add 'createnewaddress' command, separate from getunusedaddress --- lib/commands.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/commands.py b/lib/commands.py index 916d5a65..818e524e 100644 --- a/lib/commands.py +++ b/lib/commands.py @@ -605,21 +605,21 @@ class Commands: return list(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 + def createnewaddress(self): + """Create a new receiving address, beyond the gap limit of the wallet""" + return self.wallet.create_new_address(False) + @command('w') + def getunusedaddress(self): + """Returns the first unused address of the wallet, or None if all addresses are used. + An address is considered as used if it has received a transaction, or if it is used in a payment request.""" + return self.wallet.get_unused_address() @command('w') def addrequest(self, amount, memo='', expiration=None, force=False): - """Create a payment request.""" + """Create a payment request, using the first unused address of the wallet. + The address will be condidered as used after this operation. + If no payment is received, the address will be considered as unused if the payment request is deleted from the wallet.""" addr = self.wallet.get_unused_address() if addr is None: if force: