Skip to content

Commit

Permalink
wip: use che correct next_point with splice
Browse files Browse the repository at this point in the history
Signed-off-by: Vincenzo Palazzo <[email protected]>
  • Loading branch information
vincenzopalazzo committed Oct 27, 2023
1 parent 34692ec commit 7ded7a7
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions channeld/channeld.c
Original file line number Diff line number Diff line change
Expand Up @@ -1974,7 +1974,8 @@ static struct commitsig *handle_peer_commit_sig(struct peer *peer,
u32 commit_index,
const struct htlc **changed_htlcs,
s64 splice_amnt,
s64 remote_splice_amnt)
s64 remote_splice_amnt,
struct secret *old_secret)
{
struct commitsig *result;
struct channel_id channel_id;
Expand Down Expand Up @@ -2199,7 +2200,6 @@ static struct commitsig *handle_peer_commit_sig(struct peer *peer,
htlc_sigs);
tal_free(htlcs);
msg2 = hsm_req(tmpctx, take(msg2));
struct secret *old_secret;
struct pubkey next_point;
if (!fromwire_hsmd_validate_commitment_tx_reply(tmpctx, msg2, &old_secret, &next_point))
status_failed(STATUS_FAIL_HSM_IO,
Expand Down Expand Up @@ -2237,7 +2237,8 @@ static struct commitsig *handle_peer_commit_sig(struct peer *peer,
/* We purposely just store the last commit msg */
result = handle_peer_commit_sig(peer, splice_msg, i + 1,
changed_htlcs, sub_splice_amnt,
funding_diff - sub_splice_amnt);
funding_diff - sub_splice_amnt,
old_secret);
tal_arr_expand(&commitsigs, result);
tal_steal(commitsigs, result);
}
Expand Down Expand Up @@ -2863,7 +2864,7 @@ static struct commitsig *interactive_send_commitments(struct peer *peer,
if (fromwire_peektype(msg) == WIRE_COMMITMENT_SIGNED) {
commit_msg = msg;
result = handle_peer_commit_sig(peer, commit_msg, 0,
NULL, 0, 0);
NULL, 0, 0, NULL);

msg = peer_expect_msg(tmpctx, peer,
WIRE_REVOKE_AND_ACK, 0);
Expand All @@ -2876,7 +2877,7 @@ static struct commitsig *interactive_send_commitments(struct peer *peer,
commit_msg = peer_expect_msg(tmpctx, peer,
WIRE_COMMITMENT_SIGNED, 0);
result = handle_peer_commit_sig(peer, commit_msg, 0,
NULL, 0, 0);
NULL, 0, 0, NULL);
}

if (!do_i_sign_first(peer, psbt, our_role)) {
Expand Down Expand Up @@ -4274,7 +4275,7 @@ static void peer_in(struct peer *peer, const u8 *msg)
handle_peer_add_htlc(peer, msg);
return;
case WIRE_COMMITMENT_SIGNED:
handle_peer_commit_sig(peer, msg, 0, NULL, 0, 0);
handle_peer_commit_sig(peer, msg, 0, NULL, 0, 0, NULL);
return;
case WIRE_UPDATE_FEE:
handle_peer_feechange(peer, msg);
Expand Down

0 comments on commit 7ded7a7

Please sign in to comment.