Skip to content

Commit de7b416

Browse files
cdeckerrustyrussell
authored andcommitted
db: Fix size mismatch on postgres in a migration
Changelog-Fixed: db: Fixed a broken migration on postgres DBs that had really old channels.
1 parent a08e835 commit de7b416

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

wallet/db.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,7 +1253,7 @@ static void fillin_missing_channel_id(struct lightningd *ld, struct db *db,
12531253
struct channel_id cid;
12541254
u32 outnum;
12551255

1256-
id = db_column_int(stmt, 0);
1256+
id = db_column_u64(stmt, 0);
12571257
db_column_txid(stmt, 1, &funding_txid);
12581258
outnum = db_column_int(stmt, 2);
12591259
derive_channel_id(&cid, &funding_txid, outnum);
@@ -1262,7 +1262,7 @@ static void fillin_missing_channel_id(struct lightningd *ld, struct db *db,
12621262
" SET full_channel_id = ?"
12631263
" WHERE id = ?;"));
12641264
db_bind_channel_id(update_stmt, 0, &cid);
1265-
db_bind_int(update_stmt, 1, id);
1265+
db_bind_u64(update_stmt, 1, id);
12661266

12671267
db_exec_prepared_v2(update_stmt);
12681268
tal_free(update_stmt);

wallet/db_postgres_sqlgen.c

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wallet/db_sqlite3_sqlgen.c

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wallet/statements_gettextgen.po

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)