summaryrefslogtreecommitdiff
path: root/ledger_process.py
diff options
context:
space:
mode:
Diffstat (limited to 'ledger_process.py')
-rw-r--r--ledger_process.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/ledger_process.py b/ledger_process.py
index 6916b5e..08aea10 100644
--- a/ledger_process.py
+++ b/ledger_process.py
@@ -59,7 +59,9 @@ class LedgerProcess:
self.external_wallet.setdefault(currency, FIFOQueue())
self.fifo_queues.setdefault(currency, FIFOQueue())
- t = self.external_wallet[currency].remove(lambda t: t.amount == action.amount)
+ t = self.external_wallet[currency].remove(
+ lambda t: t.amount == action.amount and t.timestamp < action.timestamp
+ )
# Fee handling: Kraken shows "full" amount first, I have to subtract the fee.
wallet = self.fifo_queues[currency]