Browse Source

df-tests: test_channel_opened_notification

We weren't sending a channel_open notification for dual-funded channels.

This is only sent for the 'accepter' side. We send it as soon as both
funding_tx sigs have been exchanged, even though it's possible the
funding transaction might be published without this having been the case.

Since we fail the channel if this happens, only notifying for good/valid
channels reaching the broadcast state is the right way to handle this.
ppa
niftynei 4 years ago
committed by Christian Decker
parent
commit
ff0e2dbd28
  1. 20
      lightningd/dual_open_control.c

20
lightningd/dual_open_control.c

@ -1295,6 +1295,16 @@ static void handle_peer_tx_sigs_sent(struct subd *dualopend,
DUALOPEND_AWAITING_LOCKIN,
REASON_UNKNOWN,
"Sigs exchanged, waiting for lock-in");
/* Mimic the old behavior, notify a channel has been opened,
* for the accepter side */
if (channel->opener == REMOTE)
/* Tell plugins about the success */
notify_channel_opened(dualopend->ld,
&channel->peer->id,
&channel->funding,
&channel->funding_txid,
&channel->remote_funding_locked);
}
}
@ -1516,6 +1526,16 @@ static void handle_peer_tx_sigs_msg(struct subd *dualopend,
DUALOPEND_AWAITING_LOCKIN,
REASON_UNKNOWN,
"Sigs exchanged, waiting for lock-in");
/* Mimic the old behavior, notify a channel has been opened,
* for the accepter side */
if (channel->opener == REMOTE)
/* Tell plugins about the success */
notify_channel_opened(dualopend->ld,
&channel->peer->id,
&channel->funding,
&channel->funding_txid,
&channel->remote_funding_locked);
}
wallet_channel_save(ld->wallet, channel);

Loading…
Cancel
Save