electrum

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

commit cc852ef6a5731bb9a8e8d5ec3323aff808a42c34
parent ed2db4be8047d7807e6c2cac3041d2468199961c
Author: ThomasV <thomasv@electrum.org>
Date:   Mon,  6 Mar 2017 12:32:11 +0100

Merge pull request #2123 from gdiepen/master

Implemented getunusedaddress command
Diffstat:
Mlib/commands.py | 13+++++++++++++
1 file changed, 13 insertions(+), 0 deletions(-)

diff --git a/lib/commands.py b/lib/commands.py @@ -569,6 +569,19 @@ class Commands: 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.""" addr = self.wallet.get_unused_address()