Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions lightningd/channel_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -735,10 +735,10 @@ static void process_check_funding_broadcast(struct bitcoind *bitcoind,
/* Peer could have errored out while we were waiting */
peer = peer_by_id(bitcoind->ld, &cc->peer);
if (!peer)
return;
goto cleanup;
cancel = find_channel_by_id(peer, &cc->cid);
if (!cancel)
return;
goto cleanup;

if (txout != NULL) {
for (size_t i = 0; i < tal_count(cancel->forgets); i++)
Expand All @@ -748,13 +748,17 @@ static void process_check_funding_broadcast(struct bitcoind *bitcoind,
"please consider `close` or `dev-fail`! "));
tal_free(cancel->forgets);
cancel->forgets = tal_arr(cancel, struct command *, 0);
return;
goto cleanup;
}

char *error_reason = "Cancel channel by our RPC "
"command before funding "
"transaction broadcast.";
forget_channel(cancel, error_reason);

cleanup:
tal_free(cc);
return;
}

struct command_result *cancel_channel_before_broadcast(struct command *cmd,
Expand Down Expand Up @@ -823,7 +827,7 @@ struct command_result *cancel_channel_before_broadcast(struct command *cmd,
&cancel_channel->funding_txid,
cancel_channel->funding_outnum,
process_check_funding_broadcast,
notleak(cc));
notleak(tal_steal(NULL, cc)));
return command_still_pending(cmd);
}

Expand Down
1 change: 1 addition & 0 deletions tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ clean: tools-clean

tools-clean:
$(RM) tools/headerversions
$(RM) tools/headerversions.o

include tools/test/Makefile