Browse Source

taker: Fix change validation logic

master
csH7KmCC9 5 years ago
parent
commit
b4ca42d30b
No known key found for this signature in database
GPG Key ID: 63B1CC785D3E57B1
  1. 6
      jmclient/jmclient/taker.py

6
jmclient/jmclient/taker.py

@ -485,12 +485,12 @@ class Taker(object):
#we have tried to avoid this based on over-estimating the needed amount #we have tried to avoid this based on over-estimating the needed amount
#in SendPayment.create_tx(), but it is still a possibility if one maker #in SendPayment.create_tx(), but it is still a possibility if one maker
#uses a *lot* of inputs. #uses a *lot* of inputs.
if self.my_change_addr and my_change_value <= 0: if self.my_change_addr:
if my_change_value < 0:
raise ValueError("Calculated transaction fee of: " + raise ValueError("Calculated transaction fee of: " +
btc.amount_to_str(self.total_txfee) + btc.amount_to_str(self.total_txfee) +
" is too large for our inputs; Please try again.") " is too large for our inputs; Please try again.")
elif self.my_change_addr and my_change_value <= jm_single( if my_change_value <= jm_single().BITCOIN_DUST_THRESHOLD:
).BITCOIN_DUST_THRESHOLD:
jlog.info("Dynamically calculated change lower than dust: " + jlog.info("Dynamically calculated change lower than dust: " +
btc.amount_to_str(my_change_value) + "; dropping.") btc.amount_to_str(my_change_value) + "; dropping.")
self.my_change_addr = None self.my_change_addr = None

Loading…
Cancel
Save