fix: check tx_date match when filtering for inverse record

This commit is contained in:
Mohamed Sohail 2024-02-07 12:09:13 +03:00
parent 8cb78eb2db
commit a99907f2b9
Signed by: kamikazechaser
GPG Key ID: 7DD45520C01CD85D

View File

@ -30,12 +30,13 @@ func (r *HooksContainer) bootstrapTransactionHook() {
inverseTransactionRecord, err := r.pb.Dao().FindFirstRecordByFilter( inverseTransactionRecord, err := r.pb.Dao().FindFirstRecordByFilter(
"transactions", "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{ dbx.Params{
"completed": false, "completed": false,
"quantity": transactionRecord.GetInt("evergrow_quantity"), "quantity": transactionRecord.GetInt("evergrow_quantity"),
"initiator": counterpartyRecord.GetId(), "initiator": counterpartyRecord.GetId(),
"counterparty": initiatorRecord.GetId(), "counterparty": initiatorRecord.GetId(),
"tx_date": transactionRecord.GetDateTime("tx_date"),
}, },
) )
if err != nil && err != sql.ErrNoRows { if err != nil && err != sql.ErrNoRows {