@@ -1563,13 +1563,22 @@ macro_rules! commitment_signed_dance {
1563
1563
}
1564
1564
}
1565
1565
1566
+ /// Runs the commitment_signed dance after the initial commitment_signed is delivered through to
1567
+ /// the initiator's `revoke_and_ack` resposne. i.e. [`do_main_commitment_signed_dance`] plus the
1568
+ /// `revoke_and_ack` response to it.
1569
+ ///
1570
+ /// Returns any additional message `node_b` generated in addition to the `revoke_and_ack` response.
1566
1571
pub fn commitment_signed_dance_through_cp_raa ( node_a : & Node < ' _ , ' _ , ' _ > , node_b : & Node < ' _ , ' _ , ' _ > , fail_backwards : bool ) -> Option < MessageSendEvent > {
1567
1572
let ( extra_msg_option, bs_revoke_and_ack) = do_main_commitment_signed_dance ( node_a, node_b, fail_backwards) ;
1568
1573
node_a. node . handle_revoke_and_ack ( & node_b. node . get_our_node_id ( ) , & bs_revoke_and_ack) ;
1569
1574
check_added_monitors ( node_a, 1 ) ;
1570
1575
extra_msg_option
1571
1576
}
1572
1577
1578
+ /// Does the main logic in the commitment_signed dance. After the first `commitment_signed` has
1579
+ /// been delivered, this method picks up and delivers the response `revoke_and_ack` and
1580
+ /// `commitment_signed`, returning the receipient's `revoke_and_ack` and any extra message it may
1581
+ /// have included.
1573
1582
pub fn do_main_commitment_signed_dance ( node_a : & Node < ' _ , ' _ , ' _ > , node_b : & Node < ' _ , ' _ , ' _ > , fail_backwards : bool ) -> ( Option < MessageSendEvent > , msgs:: RevokeAndACK ) {
1574
1583
let ( as_revoke_and_ack, as_commitment_signed) = get_revoke_commit_msgs ! ( node_a, node_b. node. get_our_node_id( ) ) ;
1575
1584
check_added_monitors ! ( node_b, 0 ) ;
@@ -1598,6 +1607,11 @@ pub fn do_main_commitment_signed_dance(node_a: &Node<'_, '_, '_>, node_b: &Node<
1598
1607
( extra_msg_option, bs_revoke_and_ack)
1599
1608
}
1600
1609
1610
+ /// Runs a full commitment_signed dance, delivering a commitment_signed, the responding
1611
+ /// `revoke_and_ack` and `commitment_signed`, and then the final `revoke_and_ack` response.
1612
+ ///
1613
+ /// If `skip_last_step` is unset, also checks for the payment failure update for the previous hop
1614
+ /// on failure or that no new messages are left over on success.
1601
1615
pub fn do_commitment_signed_dance ( node_a : & Node < ' _ , ' _ , ' _ > , node_b : & Node < ' _ , ' _ , ' _ > , commitment_signed : & msgs:: CommitmentSigned , fail_backwards : bool , skip_last_step : bool ) {
1602
1616
check_added_monitors ! ( node_a, 0 ) ;
1603
1617
assert ! ( node_a. node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
0 commit comments