diff options
author | uvok | 2025-04-18 19:37:53 +0200 |
---|---|---|
committer | uvok | 2025-04-18 19:37:53 +0200 |
commit | cd0777e35e114ed485706fa58d475e2352e1c42a (patch) | |
tree | dec117700c87ee94672fc408d09d5d62613b4387 | |
parent | e090067631255ddfeb042545f62a8e95c26c7946 (diff) |
Check timestamp of trade to be removed
-rw-r--r-- | ledger_process.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ledger_process.py b/ledger_process.py index 8b7a614..6916b5e 100644 --- a/ledger_process.py +++ b/ledger_process.py @@ -78,8 +78,9 @@ class LedgerProcess: self.external_wallet.setdefault(currency, FIFOQueue()) self.fifo_queues.setdefault(currency, FIFOQueue()) + withdraw_total = -action.amount + action.fee t = self.fifo_queues[currency].remove( - lambda t: t.amount == -action.amount + action.fee + lambda t: t.amount == withdraw_total and t.timestamp < action.timestamp ) t.remove_coins(action.fee) self.external_wallet[currency].add_trade(t) |