-
Notifications
You must be signed in to change notification settings - Fork 1k
lightningd: store raw failure message so waitsendpay always has raw_message #9342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4322,7 +4322,8 @@ void wallet_payment_get_failinfo(const tal_t *ctx, | |
| struct short_channel_id **failchannel, | ||
| u8 **failupdate, | ||
| char **faildetail, | ||
| int *faildirection) | ||
| int *faildirection, | ||
| u8 **failmsg) | ||
| { | ||
| struct db_stmt *stmt; | ||
| bool resb; | ||
|
|
@@ -4332,6 +4333,7 @@ void wallet_payment_get_failinfo(const tal_t *ctx, | |
| ", failindex, failcode" | ||
| ", failnode, failscid" | ||
| ", failupdate, faildetail, faildirection" | ||
| ", failmsg" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we mention
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point - added a note to wallet_payment_get_failinfo's doc comment: *failmsg is NULL when no raw onion failure message was recorded (local and self-payment failures, and payments that failed before the migration added the column). Kept it as a separate fixup commit for reviewability; will squash before merge. |
||
| " FROM payments" | ||
| " WHERE payment_hash=? AND partid=? AND groupid=?;")); | ||
| db_bind_sha256(stmt, payment_hash); | ||
|
|
@@ -4366,6 +4368,10 @@ void wallet_payment_get_failinfo(const tal_t *ctx, | |
| *faildetail = db_col_strdup(ctx, stmt, "faildetail"); | ||
| else | ||
| *faildetail = NULL; | ||
| if (db_col_is_null(stmt, "failmsg")) | ||
| *failmsg = NULL; | ||
| else | ||
| *failmsg = db_col_arr(ctx, stmt, "failmsg", u8); | ||
|
|
||
| tal_free(stmt); | ||
| } | ||
|
|
@@ -4381,7 +4387,8 @@ void wallet_payment_set_failinfo(struct wallet *wallet, | |
| const struct short_channel_id *failchannel, | ||
| const u8 *failupdate /*tal_arr*/, | ||
| const char *faildetail, | ||
| int faildirection) | ||
| int faildirection, | ||
| const u8 *failmsg /*tal_arr*/) | ||
| { | ||
| struct db_stmt *stmt; | ||
|
|
||
|
|
@@ -4395,6 +4402,7 @@ void wallet_payment_set_failinfo(struct wallet *wallet, | |
| " , faildirection=?" | ||
| " , failupdate=?" | ||
| " , faildetail=?" | ||
| " , failmsg=?" | ||
| " WHERE payment_hash=?" | ||
| " AND partid=?;")); | ||
| if (failonionreply) | ||
|
|
@@ -4425,6 +4433,8 @@ void wallet_payment_set_failinfo(struct wallet *wallet, | |
| else | ||
| db_bind_null(stmt); | ||
|
|
||
| db_bind_talarr(stmt, failmsg); | ||
|
|
||
| db_bind_sha256(stmt, payment_hash); | ||
| db_bind_u64(stmt, partid); | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
ALTER TABLE - ADD failmsg BLOBis valid on aSTRICTtable (BLOBis an allowed strict type), so this won't breaktest_sqlite_strict_mode!