Skip to content

Commit

Permalink
db: Fix size mismatch on postgres in a migration
Browse files Browse the repository at this point in the history
Changelog-Fixed: db: Fixed a broken migration on postgres DBs that had really old channels.
  • Loading branch information
cdecker committed Sep 18, 2020
1 parent a88073f commit bdab7fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wallet/db.c
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,7 @@ static void fillin_missing_channel_id(struct lightningd *ld, struct db *db,
struct channel_id cid;
u32 outnum;

id = db_column_int(stmt, 0);
id = db_column_u64(stmt, 0);
db_column_txid(stmt, 1, &funding_txid);
outnum = db_column_int(stmt, 2);
derive_channel_id(&cid, &funding_txid, outnum);
Expand All @@ -1262,7 +1262,7 @@ static void fillin_missing_channel_id(struct lightningd *ld, struct db *db,
" SET full_channel_id = ?"
" WHERE id = ?;"));
db_bind_channel_id(update_stmt, 0, &cid);
db_bind_int(update_stmt, 1, id);
db_bind_u64(update_stmt, 1, id);

db_exec_prepared_v2(update_stmt);
tal_free(update_stmt);
Expand Down

0 comments on commit bdab7fe

Please sign in to comment.