Merge pull request #427 from lbryio/fix_new_address

Prevent excessive generation of new addresses
This commit is contained in:
Umpei Kay Kurokawa 2017-01-20 17:14:21 -05:00 committed by GitHub
commit 60195ed6d4

View file

@ -1035,7 +1035,10 @@ class LBRYumWallet(Wallet):
return d
def get_new_address(self):
d = defer.succeed(self.wallet.create_new_address())
addr = self.wallet.get_unused_address(account=None)
if addr is None:
addr = self.wallet.create_new_address()
d = defer.succeed(addr)
d.addCallback(self._save_wallet)
return d