mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-21 16:14:23 +01:00
plugins/keysend: prevent leak detecting getting upset.
1. We don't keep a pointer to payments (unlike pay, which keeps a linked list), so mark it notleak. 2. plugin->our_features is overloaded for "features we want to set" (used by keysend) and then "features we have". Create a new field, which is cleaner. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <ccan/asort/asort.h>
|
||||
#include <ccan/tal/str/str.h>
|
||||
#include <common/json_tok.h>
|
||||
#include <common/memleak.h>
|
||||
#include <common/type_to_string.h>
|
||||
#include <plugins/libplugin-pay.h>
|
||||
#include <sodium.h>
|
||||
@@ -223,7 +224,7 @@ static struct command_result *json_keysend(struct command *cmd, const char *buf,
|
||||
p->label = tal_steal(p, label);
|
||||
payment_start(p);
|
||||
/* We're keeping this around now */
|
||||
tal_steal(cmd->plugin, p);
|
||||
tal_steal(cmd->plugin, notleak(p));
|
||||
return command_still_pending(cmd);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user