From a99907f2b9b618424b47b1d58c0fcb4243f10285 Mon Sep 17 00:00:00 2001 From: Mohammed Sohail Date: Wed, 7 Feb 2024 12:09:13 +0300 Subject: [PATCH] fix: check tx_date match when filtering for inverse record --- internal/hooks/transaction.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/hooks/transaction.go b/internal/hooks/transaction.go index f6269ea..69357fd 100644 --- a/internal/hooks/transaction.go +++ b/internal/hooks/transaction.go @@ -30,12 +30,13 @@ func (r *HooksContainer) bootstrapTransactionHook() { inverseTransactionRecord, err := r.pb.Dao().FindFirstRecordByFilter( "transactions", - "completed = {:completed} && evergrow_quantity = {:quantity} && initiator = {:initiator} && counterparty = {:counterparty}", + "completed = {:completed} && evergrow_quantity = {:quantity} && initiator = {:initiator} && counterparty = {:counterparty} && tx_date = {:tx_date}", dbx.Params{ "completed": false, "quantity": transactionRecord.GetInt("evergrow_quantity"), "initiator": counterpartyRecord.GetId(), "counterparty": initiatorRecord.GetId(), + "tx_date": transactionRecord.GetDateTime("tx_date"), }, ) if err != nil && err != sql.ErrNoRows {