Skip to content

Commit ba07377

Browse files
committed
splice: Update splice signature msg type
Update to use spec signature type. Changelog-None
1 parent 7921ce7 commit ba07377

File tree

2 files changed

+5
-22
lines changed

2 files changed

+5
-22
lines changed

channeld/channeld.c

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3218,8 +3218,6 @@ static void resume_splice_negotiation(struct peer *peer,
32183218
struct wally_psbt *current_psbt = inflight->psbt;
32193219
struct commitsig *their_commit;
32203220
const struct witness **outws;
3221-
u8 der[73];
3222-
size_t der_len;
32233221
struct bitcoin_signature splice_sig;
32243222
struct bitcoin_tx *bitcoin_tx;
32253223
u32 splice_funding_index;
@@ -3331,9 +3329,7 @@ static void resume_splice_negotiation(struct peer *peer,
33313329
fmt_wally_psbt(tmpctx, current_psbt));
33323330

33333331
txsig_tlvs = tlv_txsigs_tlvs_new(tmpctx);
3334-
der_len = signature_to_der(der, &splice_sig);
3335-
txsig_tlvs->funding_outpoint_sig = tal_dup_arr(tmpctx, u8, der,
3336-
der_len, 0);
3332+
txsig_tlvs->shared_input_signature = &splice_sig.s;
33373333

33383334
/* DTODO: is this finalize call required? */
33393335
psbt_finalize(current_psbt);
@@ -3422,21 +3418,8 @@ static void resume_splice_negotiation(struct peer *peer,
34223418
/* BOLT-a8b9f495cac28124c69cc5ee429f9ef2bacb9921 #2:
34233419
* Both nodes:
34243420
* - MUST sign the transaction using SIGHASH_ALL */
3425-
their_sig->sighash_type = SIGHASH_ALL;
3426-
3427-
if (!signature_from_der(their_txsigs_tlvs->funding_outpoint_sig,
3428-
tal_count(their_txsigs_tlvs->funding_outpoint_sig),
3429-
their_sig)) {
3430-
3431-
tal_free(their_txsigs_tlvs);
3432-
peer_failed_warn(peer->pps, &peer->channel_id,
3433-
"Splicing bad tx_signatures %s",
3434-
tal_hex(msg, msg));
3435-
}
3436-
if (peer->splicing)
3437-
peer->splicing->their_sig = tal_steal(peer->splicing,
3438-
their_sig);
3439-
tal_free(their_txsigs_tlvs);
3421+
their_sig.sighash_type = SIGHASH_ALL;
3422+
their_sig.s = *their_txsigs_tlvs->shared_input_signature;
34403423

34413424
/* Set the commit_sig on the commitment tx psbt */
34423425
if (!psbt_input_set_signature(current_psbt,

wire/peer_wire.csv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ msgdata,tx_signatures,tlvs,txsigs_tlvs,
7070
subtype,witness
7171
subtypedata,witness,len,u16,
7272
subtypedata,witness,witness_data,byte,len
73-
tlvtype,txsigs_tlvs,funding_outpoint_sig,0
74-
tlvdata,txsigs_tlvs,funding_outpoint_sig,sig,byte,...
73+
tlvtype,txsigs_tlvs,shared_input_signature,0
74+
tlvdata,txsigs_tlvs,shared_input_signature,signature,signature,
7575
msgtype,tx_init_rbf,72
7676
msgdata,tx_init_rbf,channel_id,channel_id,
7777
msgdata,tx_init_rbf,locktime,u32,

0 commit comments

Comments
 (0)