mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
param: add ok flag to struct command
Callers to param() can now optionally set a flag to see if command_fail was called. This is necessary because the `cmd` is freed in case of failure. I spent a bit of time trying to extend the lifetime of the `cmd` to the end of parse_request(), but the destructors still needed to be called when they were, and it was getting ugly. So I took this minimal approach. Signed-off-by: Mark Beckwith <wythe@intrig.com>
This commit is contained in:
committed by
Christian Decker
parent
30b67c0334
commit
1a4f355a7b
@@ -37,6 +37,7 @@ struct command {
|
||||
enum command_mode mode;
|
||||
/* This is created if mode is CMD_USAGE */
|
||||
const char *usage;
|
||||
bool *ok;
|
||||
};
|
||||
|
||||
struct json_connection {
|
||||
|
||||
Reference in New Issue
Block a user