diff --git a/CHANGELOG.md b/CHANGELOG.md index 8db7731d8..d8e1b2f8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ at anytime. * fixed the inconsistencies in API and CLI docstrings * `blob_announce` error when announcing a single blob * `blob_list` error when looking up blobs by stream or sd hash + * issue#1107 whereing claiming a channel with the exact amount present in wallet would give out proper error + * ### Deprecated * `report_bug` jsonrpc command @@ -27,6 +29,7 @@ at anytime. ### Added * scripts to autogenerate documentation + * now updating new channel also takes into consideration the original bid amount, so now channel could be updated for wallet balance + the original bid amount * ### Removed diff --git a/lbrynet/core/Wallet.py b/lbrynet/core/Wallet.py index d2fc3c94e..9a9b183f1 100644 --- a/lbrynet/core/Wallet.py +++ b/lbrynet/core/Wallet.py @@ -502,6 +502,10 @@ class Wallet(object): raise Exception("New channel claim should have no fields other than name") log.info("Preparing to make certificate claim for %s", channel_name) channel_claim = yield self._claim_certificate(parsed_channel_name.name, amount) + if not channel_claim['success']: + log.error(channel_claim) + msg = 'Claim to name {} failed: {}'.format(channel_name, channel_claim['reason']) + raise Exception(msg) yield self.save_claim(self._get_temp_claim_info(channel_claim, channel_name, amount)) defer.returnValue(channel_claim) diff --git a/lbrynet/daemon/Daemon.py b/lbrynet/daemon/Daemon.py index 516264633..99e0c8efd 100644 --- a/lbrynet/daemon/Daemon.py +++ b/lbrynet/daemon/Daemon.py @@ -1851,8 +1851,12 @@ class Daemon(AuthJSONRPCServer): raise Exception("Invalid channel name") if amount <= 0: raise Exception("Invalid amount") - if amount > self.session.wallet.get_balance(): - raise InsufficientFundsError() + + amt = yield self.session.wallet.get_max_usable_balance_for_claim(channel_name) + if amount > amt: + raise InsufficientFundsError( + "Please lower the bid value, the maximum amount you can specify for this claim is {}" + .format(amt - MAX_UPDATE_FEE_ESTIMATE)) result = yield self.session.wallet.claim_new_channel(channel_name, amount) self.analytics_manager.send_new_channel()