Skip to content

Commit

Permalink
dev_restart: remove this command.
Browse files Browse the repository at this point in the history
We'll end up doing this via packet traffic (like permfail) I imagine.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell authored and cdecker committed Aug 29, 2017
1 parent 8c22bd9 commit 0170224
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 41 deletions.
35 changes: 0 additions & 35 deletions lightningd/jsonrpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,41 +231,6 @@ static const struct json_command dev_crash_command = {
};
AUTODATA(json_command, &dev_crash_command);

/* UNIFICATION FIXME */
void debug_dump_peers(struct lightningd_state *dstate);

static void json_restart(struct command *cmd,
const char *buffer, const jsmntok_t *params)
{
const jsmntok_t *p, *end;
size_t n = 0;

if (params->type != JSMN_ARRAY) {
command_fail(cmd, "Need array to reexec");
return;
}
end = json_next(params);

cmd->dstate->reexec = tal_arrz(cmd->dstate, char *, n+1);
for (p = params + 1; p != end; p = json_next(p)) {
tal_resizez(&cmd->dstate->reexec, n+2);
cmd->dstate->reexec[n++] = tal_strndup(cmd->dstate->reexec,
buffer + p->start,
p->end - p->start);
}
debug_dump_peers(cmd->dstate);
io_break(cmd->dstate);
command_success(cmd, null_response(cmd));
}

static const struct json_command dev_restart_command = {
"dev-restart",
json_restart,
"Re-exec the given {binary}.",
"Simple restart test for developers"
};
AUTODATA(json_command, &dev_restart_command);

static void json_getinfo(struct command *cmd,
const char *buffer, const jsmntok_t *params)
{
Expand Down
6 changes: 0 additions & 6 deletions lightningd/lightningd.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@ struct peer *find_peer_by_unique_id(struct lightningd *ld, u64 unique_id)
return NULL;
}

void debug_dump_peers(struct lightningd_state *dstate);
void debug_dump_peers(struct lightningd_state *dstate)
{
FIXME_IMPLEMENT();
}

void notify_new_block(struct chain_topology *topo, u32 height);
void notify_new_block(struct chain_topology *topo, u32 height)
{
Expand Down

0 comments on commit 0170224

Please sign in to comment.