mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
plugins/bcli: handle memleak.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
b82e5be6e1
commit
af7ed03921
@@ -851,6 +851,13 @@ static void wait_and_check_bitcoind(struct plugin *p)
|
|||||||
tal_free(cmd);
|
tal_free(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if DEVELOPER
|
||||||
|
static void memleak_mark_bitcoind(struct plugin *p, struct htable *memtable)
|
||||||
|
{
|
||||||
|
memleak_remove_region(memtable, bitcoind, sizeof(*bitcoind));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static const char *init(struct plugin *p, const char *buffer UNUSED,
|
static const char *init(struct plugin *p, const char *buffer UNUSED,
|
||||||
const jsmntok_t *config UNUSED)
|
const jsmntok_t *config UNUSED)
|
||||||
{
|
{
|
||||||
@@ -862,6 +869,9 @@ static const char *init(struct plugin *p, const char *buffer UNUSED,
|
|||||||
else
|
else
|
||||||
bitcoind->fake_fees = false;
|
bitcoind->fake_fees = false;
|
||||||
|
|
||||||
|
#if DEVELOPER
|
||||||
|
plugin_set_memleak_handler(p, memleak_mark_bitcoind);
|
||||||
|
#endif
|
||||||
plugin_log(p, LOG_INFORM,
|
plugin_log(p, LOG_INFORM,
|
||||||
"bitcoin-cli initialized and connected to bitcoind.");
|
"bitcoin-cli initialized and connected to bitcoind.");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user