mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 01:43:36 +01:00
dualfund: when dropping to chain, only drop if we have a commitment tx
You can't publish a tx you don't have!
This commit is contained in:
parent
b9376ac66b
commit
30babab1ed
@ -390,10 +390,13 @@ void drop_to_chain(struct lightningd *ld, struct channel *channel,
|
||||
|
||||
/* We need to drop *every* commitment transaction to chain */
|
||||
if (!cooperative && !list_empty(&channel->inflights)) {
|
||||
list_for_each(&channel->inflights, inflight, list)
|
||||
list_for_each(&channel->inflights, inflight, list) {
|
||||
if (!inflight->last_tx)
|
||||
continue;
|
||||
tx = sign_and_send_last(tmpctx, ld, channel, cmd_id,
|
||||
inflight->last_tx,
|
||||
&inflight->last_sig);
|
||||
}
|
||||
} else
|
||||
tx = sign_and_send_last(tmpctx, ld, channel, cmd_id, channel->last_tx,
|
||||
&channel->last_sig);
|
||||
|
Loading…
Reference in New Issue
Block a user