optimize to only do network calls if necessary
This commit is contained in:
parent
a70958da41
commit
93a7c46977
@ -368,13 +368,14 @@ class FreqtradeBot(object):
|
||||
# TODO: correct place here ??
|
||||
# Try update amount (binance-fix)
|
||||
try:
|
||||
new_amount = self.get_real_amount(trade)
|
||||
# This may break if a exchange applies no fee (which appears highly unlikely)
|
||||
if order['amount'] != new_amount and trade.fee_open != 0:
|
||||
logger.info("Updating amount for Trade {} from {} to {}".format(
|
||||
trade, order['amount'], new_amount))
|
||||
order['amount'] = new_amount
|
||||
trade.fee_open = 0
|
||||
if trade.fee_open != 0:
|
||||
new_amount = self.get_real_amount(trade)
|
||||
# This may break if a exchange applies no fee (which appears highly unlikely)
|
||||
if order['amount'] != new_amount:
|
||||
logger.info("Updating amount for Trade {} from {} to {}".format(
|
||||
trade, order['amount'], new_amount))
|
||||
order['amount'] = new_amount
|
||||
trade.fee_open = 0
|
||||
|
||||
except OperationalException as exception:
|
||||
logger.warning("could not update trade amount: %s", exception)
|
||||
|
Loading…
Reference in New Issue
Block a user