electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 6656154b780a5d2c8adc2a7695e9912fad16db68
parent de85b56e0aeac52463530dab3e54f1a35128ee3b
Author: ThomasV <thomasv@electrum.org>
Date:   Wed, 11 Oct 2017 12:07:41 +0200

add 'createnewaddress' command, separate from getunusedaddress

Diffstat:
Mlib/commands.py | 22+++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)

diff --git 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: