Fix: fix rare concurrency bug on cashOut

This commit is contained in:
csrapr 2021-04-14 18:04:07 +01:00
parent 58b74a6425
commit db315490d9

View file

@ -19,7 +19,7 @@ function atomic (tx, pi, fromClient) {
const tmSRD = new TransactionMode({tiLevel: isolationLevel.serializable})
function transaction (t) {
const sql = 'select * from cash_out_txs where id=$1'
const sql = 'SELECT * FROM cash_out_txs WHERE id=$1 FOR UPDATE'
return t.oneOrNone(sql, [tx.id])
.then(toObj)