From e94d10d3eb04c5c78fdfb31711a08ce0ab2a326e Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Wed, 14 Mar 2018 13:47:34 -0400 Subject: [PATCH] only call get_max_usable_balance_for_claim in Wallet.py if the bid looks too high for the balance --- lbrynet/core/Wallet.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lbrynet/core/Wallet.py b/lbrynet/core/Wallet.py index f739a5849..adc01bd97 100644 --- a/lbrynet/core/Wallet.py +++ b/lbrynet/core/Wallet.py @@ -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)