Skip to content

Commit

Permalink
channeld: defer construction of revocation message until master sync
Browse files Browse the repository at this point in the history
  • Loading branch information
ksedgwic committed Jan 18, 2024
1 parent 4610473 commit b8a80d6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions channeld/channeld.c
Original file line number Diff line number Diff line change
Expand Up @@ -1934,11 +1934,6 @@ static void send_revocation(struct peer *peer,
&failed,
&added);

/* Revoke previous commit, get new point. */
msg = make_revocation_msg_from_secret(peer, peer->next_index[LOCAL]-1,
&peer->next_local_per_commit,
old_secret, next_point);

/* From now on we apply changes to the next commitment */
peer->next_index[LOCAL]++;

Expand Down Expand Up @@ -1969,6 +1964,11 @@ static void send_revocation(struct peer *peer,

peer->splice_state->await_commitment_succcess = false;

/* Revoke previous commit, get new point. */
msg = make_revocation_msg_from_secret(peer, peer->next_index[LOCAL]-2,
&peer->next_local_per_commit,
old_secret, next_point);

/* Now we can finally send revoke_and_ack to peer */
peer_write(peer->pps, take(msg));
}
Expand Down

0 comments on commit b8a80d6

Please sign in to comment.