From dcd150daf5bbcea639f78f1a30c388452a64a8dd Mon Sep 17 00:00:00 2001 From: ClaytonNorthey92 Date: Thu, 5 Sep 2024 11:23:40 -0400 Subject: [PATCH] need to select FOR UPDATE to lock row (#245) --- database/bfgd/postgres/postgres.go | 1 + 1 file changed, 1 insertion(+) diff --git a/database/bfgd/postgres/postgres.go b/database/bfgd/postgres/postgres.go index 60996a6a..e10f77cd 100644 --- a/database/bfgd/postgres/postgres.go +++ b/database/bfgd/postgres/postgres.go @@ -1092,6 +1092,7 @@ func (p *pgdb) BtcTransactionBroadcastRequestGetNext(ctx context.Context, onlyNe AND broadcast_at IS NULL AND created_at > NOW() - INTERVAL '30 minutes' %s + FOR UPDATE LIMIT 1 ) RETURNING serialized_tx