Browse Source

lightningd/jsonrpc: don't assume the jcon to be alive at command execution

Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
nifty/pset-pre
Antoine Poinsot 5 years ago
committed by Christian Decker
parent
commit
3e9fcc43f9
  1. 6
      lightningd/jsonrpc.c

6
lightningd/jsonrpc.c

@ -597,8 +597,10 @@ static struct command_result *command_exec(struct json_connection *jcon,
if (res == &pending)
assert(cmd->pending);
list_for_each(&jcon->commands, cmd, list)
assert(cmd->pending);
/* The command might outlive the connection. */
if (jcon)
list_for_each(&jcon->commands, cmd, list)
assert(cmd->pending);
return res;
}

Loading…
Cancel
Save