summaryrefslogtreecommitdiff
path: root/ledger_process.py
diff options
context:
space:
mode:
authoruvok2025-04-18 19:40:46 +0200
committeruvok2025-04-18 19:40:46 +0200
commit2a1acf26c51e494f257e88a4f040eedd4ca779ac (patch)
tree6a4a75fbf0f3aa881813303e1c18b5aac2311eda /ledger_process.py
parent4c151464b276db6d1a5b2a74736f1c696b1d3f52 (diff)
Add timestamp check to deposit
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]