fix: user

This commit is contained in:
2026-03-17 23:43:19 +08:00
parent ef8ce120bb
commit ca12e55554
8 changed files with 132 additions and 26 deletions

View File

@@ -51,7 +51,8 @@ def is_fee_tolerant_transit_pair(tx_a: TransactionRecord, tx_b: TransactionRecor
amount_b = float(tx_b.amount or 0)
if amount_a <= 0 or amount_b <= 0:
return False
if _amount_ratio_diff(amount_a, amount_b) > FEE_TOLERANCE_RATIO:
diff_ratio = _amount_ratio_diff(amount_a, amount_b)
if diff_ratio > FEE_TOLERANCE_RATIO:
return False
time_a = tx_a.trade_time
@@ -59,7 +60,8 @@ def is_fee_tolerant_transit_pair(tx_a: TransactionRecord, tx_b: TransactionRecor
if not isinstance(time_a, datetime) or not isinstance(time_b, datetime):
return False
try:
return abs((time_a - time_b).total_seconds()) <= FEE_TRANSIT_WINDOW_SECONDS
seconds_gap = abs((time_a - time_b).total_seconds())
return seconds_gap <= FEE_TRANSIT_WINDOW_SECONDS
except TypeError:
return False