Skip to content

Commit e366c19

Browse files
niftyneirustyrussell
authored andcommitted
dual-fund: send the next_funding_txid to peer
As per lightning/bolts@cd3c99e we should send the next_funding_txid if we've sent our commitment sigs, but we haven't received the peer's tx_signatures. Note that we send here, but don't verify that it's arrived.
1 parent 0cd7fe5 commit e366c19

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

openingd/dualopend.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3978,10 +3978,26 @@ static void do_reconnect_dance(struct state *state)
39783978
sizeof(last_remote_per_commit_secret));
39793979

39803980
/* We always send reconnect/reestablish */
3981+
3982+
/* BOLT-e299850cb5ebd8bd9c55763bbc498fcdf94a9567 #2:
3983+
*
3984+
* - if it has sent `commitment_signed` for an
3985+
* interactive transaction construction but it has
3986+
* not received `tx_signatures`:
3987+
* - MUST set `next_funding_txid` to the txid of that
3988+
* interactive transaction.
3989+
* - otherwise:
3990+
* - MUST NOT set `next_funding_txid`.
3991+
*/
3992+
tlvs = tlv_channel_reestablish_tlvs_new(tmpctx);
3993+
if (!tx_state->remote_funding_sigs_rcvd)
3994+
tlvs->next_funding = &tx_state->funding.txid;
3995+
39813996
msg = towire_channel_reestablish
39823997
(NULL, &state->channel_id, 1, 0,
39833998
&last_remote_per_commit_secret,
3984-
&state->first_per_commitment_point[LOCAL], NULL);
3999+
&state->first_per_commitment_point[LOCAL], tlvs);
4000+
39854001
peer_write(state->pps, take(msg));
39864002

39874003
peer_billboard(false, "Sent reestablish, waiting for theirs");

0 commit comments

Comments
 (0)