Skip to content

Commit

Permalink
lightningd/opening_control.c: Remove predeclaration.
Browse files Browse the repository at this point in the history
  • Loading branch information
ZmnSCPxj committed Nov 6, 2020
1 parent 3dbe2aa commit 094e219
Showing 1 changed file with 18 additions and 26 deletions.
44 changes: 18 additions & 26 deletions lightningd/opening_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,32 +541,6 @@ static void opening_fundee_finished(struct subd *openingd,
tal_free(uc);
}

/* These two functions used to be a single function, pre-declaring
* here in order to reduce review load since the original function
* is not really changed at all in its operation, just need access
* to the cleanup part in a separate piece of code.
*/
static void
opening_funder_failed_cancel_commands(struct uncommitted_channel *uc,
const char *desc);
static void opening_funder_failed(struct subd *openingd, const u8 *msg,
struct uncommitted_channel *uc)
{
char *desc;

if (!fromwire_openingd_funder_failed(msg, msg, &desc)) {
log_broken(uc->log,
"bad OPENING_FUNDER_FAILED %s",
tal_hex(tmpctx, msg));
was_pending(command_fail(uc->fc->cmd, LIGHTNINGD,
"bad OPENING_FUNDER_FAILED %s",
tal_hex(uc->fc->cmd, msg)));
tal_free(uc);
return;
}

opening_funder_failed_cancel_commands(uc, desc);
}
static void
opening_funder_failed_cancel_commands(struct uncommitted_channel *uc,
const char *desc)
Expand Down Expand Up @@ -596,6 +570,24 @@ opening_funder_failed_cancel_commands(struct uncommitted_channel *uc,
*/
uc->fc = tal_free(uc->fc);
}
static void opening_funder_failed(struct subd *openingd, const u8 *msg,
struct uncommitted_channel *uc)
{
char *desc;

if (!fromwire_openingd_funder_failed(msg, msg, &desc)) {
log_broken(uc->log,
"bad OPENING_FUNDER_FAILED %s",
tal_hex(tmpctx, msg));
was_pending(command_fail(uc->fc->cmd, LIGHTNINGD,
"bad OPENING_FUNDER_FAILED %s",
tal_hex(uc->fc->cmd, msg)));
tal_free(uc);
return;
}

opening_funder_failed_cancel_commands(uc, desc);
}

struct openchannel_hook_payload {
struct subd *openingd;
Expand Down

0 comments on commit 094e219

Please sign in to comment.