t--force option for addrequest - electrum - Electrum Bitcoin wallet (HTM) git clone https://git.parazyd.org/electrum (DIR) Log (DIR) Files (DIR) Refs (DIR) Submodules --- (DIR) commit f3597f865b8e47fd3a62855e6a5b5e48274a9a9b (DIR) parent 9ef1f300f38a6413ed9fdebd1e1bce4a433f8da5 (HTM) Author: ThomasV <thomasv@gitorious> Date: Thu, 11 Jun 2015 20:44:38 +0200 --force option for addrequest Diffstat: M lib/commands.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- (DIR) diff --git a/lib/commands.py b/lib/commands.py t@@ -548,11 +548,14 @@ class Commands: return map(self._format_request, self.wallet.get_sorted_requests(self.config)) @command('w') - def addrequest(self, requested_amount, memo='', expiration=60*60): + def addrequest(self, requested_amount, memo='', expiration=60*60, force=False): """Create a payment request.""" addr = self.wallet.get_unused_address(None) if addr is None: - return False + if force: + addr = self.wallet.create_new_address(None, False) + else: + return False amount = int(Decimal(requested_amount)*COIN) req = self.wallet.add_payment_request(addr, amount, memo, expiration, self.config) return self._format_request(req) t@@ -608,6 +611,7 @@ command_options = { 'memo': ("-m", "--memo", "Description of the request"), 'expiration': (None, "--expiration", "Time in seconds"), 'status': (None, "--status", "Show status"), + 'force': (None, "--force", "Create new address beyong gap limit, if no more address is available."), }