only call get_max_usable_balance_for_claim in Wallet.py if the bid looks too high for the balance

This commit is contained in:
Jack Robison 2018-03-14 13:47:34 -04:00
parent 25eb64b346
commit e94d10d3eb
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -555,9 +555,10 @@ class Wallet(object):
decoded = ClaimDict.load_dict(metadata)
serialized = decoded.serialized
amt = yield self.get_max_usable_balance_for_claim(name)
if bid > amt:
raise InsufficientFundsError()
if self.get_balance() <= bid:
amt = yield self.get_max_usable_balance_for_claim(name)
if bid > amt:
raise InsufficientFundsError()
claim = yield self._send_name_claim(name, serialized.encode('hex'),
bid, certificate_id, claim_address, change_address)