From 02ceb92286e68a7fe782d93f5c6e4b189e335da9 Mon Sep 17 00:00:00 2001 From: Yaacov Akiba Slama Date: Mon, 3 Oct 2022 11:10:38 +0300 Subject: [PATCH] Fix insertChannel in the ON CONFLICT arm --- db.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db.go b/db.go index b9337bc..02d77b4 100644 --- a/db.go +++ b/db.go @@ -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)