Skip to content

Commit

Permalink
db: Admit null value inside the db_bind_sha256
Browse files Browse the repository at this point in the history
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
  • Loading branch information
vincenzopalazzo committed Sep 14, 2021
1 parent 133f1d7 commit b074fd0
Show file tree
Hide file tree
Showing 11 changed files with 177 additions and 789 deletions.
2 changes: 1 addition & 1 deletion doc/lightning-listsendpays.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ DESCRIPTION
The **listsendpays** RPC command gets the status of all *sendpay*
commands (which is also used by the *pay* command), or with *bolt11* or
*payment\_hash* limits results to that specific payment. You cannot
specify both. It is possible filter the payments also by status.
specify both. It is possible filter the payments also by *status*.

Note that in future there may be more than one concurrent *sendpay*
command per *pay*, so this command should be used with caution.
Expand Down
5 changes: 4 additions & 1 deletion wallet/db.c
Original file line number Diff line number Diff line change
Expand Up @@ -1697,7 +1697,10 @@ void db_bind_preimage(struct db_stmt *stmt, int pos, const struct preimage *p)

void db_bind_sha256(struct db_stmt *stmt, int pos, const struct sha256 *s)
{
db_bind_blob(stmt, pos, s->u.u8, sizeof(struct sha256));
if(!s)
db_bind_null(stmt, pos);
else
db_bind_blob(stmt, pos, s->u.u8, sizeof(struct sha256));
}

void db_bind_sha256d(struct db_stmt *stmt, int pos, const struct sha256_double *s)
Expand Down
139 changes: 1 addition & 138 deletions wallet/db_postgres_sqlgen.c

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

139 changes: 1 addition & 138 deletions wallet/db_sqlite3_sqlgen.c

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

Loading

0 comments on commit b074fd0

Please sign in to comment.