mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 14:42:40 +01:00
plugin: autoclean fix double free when re-enable, remove xfail mark from test_
Fixes a crash when enabling after a disable with cycle_seconds=0.
This commit is contained in:
parent
cc40243399
commit
ad3cbed7c2
2 changed files with 3 additions and 2 deletions
|
@ -48,12 +48,14 @@ static struct command_result *json_autocleaninvoice(struct command *cmd,
|
||||||
cycle_seconds = *cycle;
|
cycle_seconds = *cycle;
|
||||||
expired_by = *exby;
|
expired_by = *exby;
|
||||||
|
|
||||||
|
cleantimer = tal_free(cleantimer);
|
||||||
|
|
||||||
if (cycle_seconds == 0) {
|
if (cycle_seconds == 0) {
|
||||||
response = jsonrpc_stream_success(cmd);
|
response = jsonrpc_stream_success(cmd);
|
||||||
json_add_bool(response, "enabled", false);
|
json_add_bool(response, "enabled", false);
|
||||||
return command_finished(cmd, response);
|
return command_finished(cmd, response);
|
||||||
}
|
}
|
||||||
tal_free(cleantimer);
|
|
||||||
cleantimer = plugin_timer(cmd->plugin, time_from_sec(cycle_seconds),
|
cleantimer = plugin_timer(cmd->plugin, time_from_sec(cycle_seconds),
|
||||||
do_clean, cmd->plugin);
|
do_clean, cmd->plugin);
|
||||||
|
|
||||||
|
|
|
@ -559,7 +559,6 @@ def test_waitanyinvoice_reversed(node_factory, executor):
|
||||||
assert r['label'] == 'inv1'
|
assert r['label'] == 'inv1'
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.xfail(strict=True)
|
|
||||||
def test_autocleaninvoice(node_factory):
|
def test_autocleaninvoice(node_factory):
|
||||||
l1 = node_factory.get_node()
|
l1 = node_factory.get_node()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue