From d2176e3385297c0b4d2df2176c5bd5446ef73707 Mon Sep 17 00:00:00 2001 From: niftynei Date: Wed, 5 Apr 2023 12:29:53 +0930 Subject: [PATCH] postgres: add missing 'update_count' to stmt Reported-By: @rustyrussell Changelog-Fixed: Plugins: `bookkeeper` onchain fees calculation was incorrect with PostgresQL. --- plugins/bkpr/recorder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bkpr/recorder.c b/plugins/bkpr/recorder.c index 0d8ab5b47..a3561b02b 100644 --- a/plugins/bkpr/recorder.c +++ b/plugins/bkpr/recorder.c @@ -342,7 +342,7 @@ struct fee_sum **find_account_onchain_fees(const tal_t *ctx, ", CAST(SUM(debit) AS BIGINT) as debit" " FROM onchain_fees" " WHERE account_id = ?" - " GROUP BY txid" + " GROUP BY txid, update_count" " ORDER BY txid, update_count")); db_bind_u64(stmt, 0, acct->db_id);