mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
plugins/libplugin-pay.c: Store the route description, and re-report on failure.
This commit is contained in:
committed by
Christian Decker
parent
6468616c02
commit
c27d7a3110
@@ -32,6 +32,7 @@ struct payment *payment_new(tal_t *ctx, struct command *cmd,
|
|||||||
p->temp_exclusion = NULL;
|
p->temp_exclusion = NULL;
|
||||||
p->failroute_retry = false;
|
p->failroute_retry = false;
|
||||||
p->bolt11 = NULL;
|
p->bolt11 = NULL;
|
||||||
|
p->routetxt = NULL;
|
||||||
|
|
||||||
/* Copy over the relevant pieces of information. */
|
/* Copy over the relevant pieces of information. */
|
||||||
if (parent != NULL) {
|
if (parent != NULL) {
|
||||||
@@ -875,6 +876,12 @@ handle_final_failure(struct command *cmd,
|
|||||||
goto nonerror;
|
goto nonerror;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
paymod_log(p, LOG_DBG,
|
||||||
|
"Final node %s reported %04x (%s) on route %s",
|
||||||
|
type_to_string(tmpctx, struct node_id, final_id),
|
||||||
|
failcode, onion_type_name(failcode),
|
||||||
|
p->routetxt);
|
||||||
|
|
||||||
/* We use an exhaustive switch statement here so you get a compile
|
/* We use an exhaustive switch statement here so you get a compile
|
||||||
* warning when new ones are added, and can think about where they go */
|
* warning when new ones are added, and can think about where they go */
|
||||||
switch (failcode) {
|
switch (failcode) {
|
||||||
@@ -969,6 +976,14 @@ handle_intermediate_failure(struct command *cmd,
|
|||||||
{
|
{
|
||||||
struct payment *root = payment_root(p);
|
struct payment *root = payment_root(p);
|
||||||
|
|
||||||
|
paymod_log(p, LOG_DBG,
|
||||||
|
"Intermediate node %s reported %04x (%s) at %s on route %s",
|
||||||
|
type_to_string(tmpctx, struct node_id, errnode),
|
||||||
|
failcode, onion_type_name(failcode),
|
||||||
|
type_to_string(tmpctx, struct short_channel_id,
|
||||||
|
&errchan->channel_id),
|
||||||
|
p->routetxt);
|
||||||
|
|
||||||
/* We use an exhaustive switch statement here so you get a compile
|
/* We use an exhaustive switch statement here so you get a compile
|
||||||
* warning when new ones are added, and can think about where they go */
|
* warning when new ones are added, and can think about where they go */
|
||||||
switch (failcode) {
|
switch (failcode) {
|
||||||
@@ -1309,6 +1324,8 @@ static void payment_compute_onion_payloads(struct payment *p)
|
|||||||
paymod_log(p, LOG_DBG,
|
paymod_log(p, LOG_DBG,
|
||||||
"Created outgoing onion for route: %s", routetxt);
|
"Created outgoing onion for route: %s", routetxt);
|
||||||
|
|
||||||
|
p->routetxt = tal_steal(p, routetxt);
|
||||||
|
|
||||||
/* Now allow all the modifiers to mess with the payloads, before we
|
/* Now allow all the modifiers to mess with the payloads, before we
|
||||||
* serialize via a call to createonion in the next step. */
|
* serialize via a call to createonion in the next step. */
|
||||||
payment_continue(p);
|
payment_continue(p);
|
||||||
|
|||||||
@@ -265,6 +265,9 @@ struct payment {
|
|||||||
|
|
||||||
/* A unique id for the root of this payment. */
|
/* A unique id for the root of this payment. */
|
||||||
u64 id;
|
u64 id;
|
||||||
|
|
||||||
|
/* A short description of the route of this payment. */
|
||||||
|
char *routetxt;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct payment_modifier {
|
struct payment_modifier {
|
||||||
|
|||||||
Reference in New Issue
Block a user