diff --git a/plugins/autoclean.c b/plugins/autoclean.c index c4d29fc02..27c91e2e4 100644 --- a/plugins/autoclean.c +++ b/plugins/autoclean.c @@ -48,12 +48,14 @@ static struct command_result *json_autocleaninvoice(struct command *cmd, cycle_seconds = *cycle; expired_by = *exby; + cleantimer = tal_free(cleantimer); + if (cycle_seconds == 0) { response = jsonrpc_stream_success(cmd); json_add_bool(response, "enabled", false); return command_finished(cmd, response); } - tal_free(cleantimer); + cleantimer = plugin_timer(cmd->plugin, time_from_sec(cycle_seconds), do_clean, cmd->plugin); diff --git a/tests/test_invoices.py b/tests/test_invoices.py index b2cb94837..ccce09218 100644 --- a/tests/test_invoices.py +++ b/tests/test_invoices.py @@ -559,7 +559,6 @@ def test_waitanyinvoice_reversed(node_factory, executor): assert r['label'] == 'inv1' -@pytest.mark.xfail(strict=True) def test_autocleaninvoice(node_factory): l1 = node_factory.get_node()