Skip to content

Commit

Permalink
db: Set the failonion to the default value on creation
Browse files Browse the repository at this point in the history
This ensures that after the migration in the previous commit we never
insert a new htlc with a null value.

Fixes: #4363

Reported-by: Zoltán Gálli <@gallizoltan>
Changelog-Fixed: db: Fixed an access to a NULL-field in the `channel_htlcs` table and resulting warning.
  • Loading branch information
cdecker authored and rustyrussell committed Feb 25, 2021
1 parent 2c1411a commit 6252930
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 71 deletions.
6 changes: 3 additions & 3 deletions wallet/db_postgres_sqlgen.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions wallet/db_sqlite3_sqlgen.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

128 changes: 64 additions & 64 deletions wallet/statements_gettextgen.po

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion wallet/wallet.c
Original file line number Diff line number Diff line change
Expand Up @@ -1954,7 +1954,8 @@ void wallet_htlc_save_out(struct wallet *wallet,
" payment_key,"
" hstate,"
" routing_onion,"
" partid) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);"));
" malformed_onion,"
" partid) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 0, ?);"));

db_bind_u64(stmt, 0, chan->dbid);
db_bind_u64(stmt, 1, out->key.id);
Expand Down

0 comments on commit 6252930

Please sign in to comment.