libplugin-pay: fix spurious leak reports.

1. The dijkstra can be temporary, doesn't need to last as long as pay cmd.
2. We fail multiple times in several places, so don't leak old failreason.
3. Make payments findable by our memleak detector.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2022-02-26 11:20:33 +10:30
parent 4b7d2dc5b8
commit 246b724dbe
2 changed files with 7 additions and 2 deletions

View File

@@ -160,11 +160,12 @@ struct payment_constraints {
};
struct payment {
/* Usually in global payments list */
struct list_node list;
/* The command that triggered this payment. Only set for the root
* payment. */
struct command *cmd;
struct plugin *plugin;
struct list_node list;
struct node_id *local_id;
const char *json_buffer;