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(
"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 {