Fix insertChannel in the ON CONFLICT arm

This commit is contained in:
Yaacov Akiba Slama
2022-10-03 11:10:38 +03:00
parent 80032bed08
commit 02ceb92286

2
db.go
View File

@@ -78,7 +78,7 @@ func insertChannel(initialChanID, confirmedChanId uint64, channelPoint string, n
query := `INSERT INTO
channels (initial_chanid, confirmed_chanid, channel_point, nodeid, last_update)
VALUES ($1, NULLIF($2, 0), $3, $4, $5)
ON CONFLICT (channel_point) DO UPDATE SET confirmed_chanid=NULLIF($2,0), last_update=$4`
ON CONFLICT (channel_point) DO UPDATE SET confirmed_chanid=NULLIF($2,0), last_update=$5`
c, err := pgxPool.Exec(context.Background(),
query, int64(initialChanID), int64(confirmedChanId), channelPoint, nodeID, lastUpdate)