@@ -1463,6 +1463,58 @@ pub enum Event {
1463
1463
///
1464
1464
/// [`ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx`]: crate::util::config::ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx
1465
1465
BumpTransaction ( BumpTransactionEvent ) ,
1466
+
1467
+ /// Indicates that a transaction constructed via interactive transaction construction for a
1468
+ /// dual-funded (V2) channel is ready to be signed by the client. This event will only be triggered
1469
+ /// if at least one input was contributed by the holder.
1470
+ ///
1471
+ /// The transaction contains all inputs provided by both parties when the channel was
1472
+ /// created/accepted along with the channel's funding output and a change output if applicable.
1473
+ ///
1474
+ /// No part of the transaction should be changed before signing as the content of the transaction
1475
+ /// has already been negotiated with the counterparty.
1476
+ ///
1477
+ /// Each signature MUST use the SIGHASH_ALL flag to avoid invalidation of initial commitment and
1478
+ /// hence possible loss of funds.
1479
+ ///
1480
+ /// After signing, call [`ChannelManager::funding_transaction_signed`] with the (partially) signed
1481
+ /// funding transaction.
1482
+ ///
1483
+ /// Generated in [`ChannelManager`] message handling.
1484
+ ///
1485
+ /// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
1486
+ /// [`ChannelManager::funding_transaction_signed`]: crate::ln::channelmanager::ChannelManager::funding_transaction_signed
1487
+ FundingTransactionReadyForSigning {
1488
+ /// The channel_id of the V2 channel which you'll need to pass back into
1489
+ /// [`ChannelManager::funding_transaction_signed`].
1490
+ ///
1491
+ /// [`ChannelManager::funding_transaction_signed`]: crate::ln::channelmanager::ChannelManager::funding_transaction_signed
1492
+ channel_id : ChannelId ,
1493
+ /// The counterparty's node_id, which you'll need to pass back into
1494
+ /// [`ChannelManager::funding_transaction_signed`].
1495
+ ///
1496
+ /// [`ChannelManager::funding_transaction_signed`]: crate::ln::channelmanager::ChannelManager::funding_transaction_signed
1497
+ counterparty_node_id : PublicKey ,
1498
+ /*
1499
+ /// The `user_channel_id` value passed in to [`ChannelManager::create_dual_funded_channel`] for outbound
1500
+ /// channels, or to [`ChannelManager::accept_inbound_channel`] or [`ChannelManager::accept_inbound_channel_with_contribution`]
1501
+ /// for inbound channels if [`UserConfig::manually_accept_inbound_channels`] config flag is set to true.
1502
+ /// Otherwise `user_channel_id` will be randomized for an inbound channel.
1503
+ /// This may be zero for objects serialized with LDK versions prior to 0.0.113.
1504
+ ///
1505
+ /// [`ChannelManager::create_dual_funded_channel`]: crate::ln::channelmanager::ChannelManager::create_dual_funded_channel
1506
+ /// [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
1507
+ /// [`ChannelManager::accept_inbound_channel_with_contribution`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_with_contribution
1508
+ /// [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
1509
+ user_channel_id: u128,
1510
+ */
1511
+ /// The unsigned transaction to be signed and passed back to
1512
+ /// [`ChannelManager::funding_transaction_signed`].
1513
+ ///
1514
+ /// [`ChannelManager::funding_transaction_signed`]: crate::ln::channelmanager::ChannelManager::funding_transaction_signed
1515
+ unsigned_transaction : Transaction ,
1516
+ } ,
1517
+
1466
1518
/// We received an onion message that is intended to be forwarded to a peer
1467
1519
/// that is currently offline. This event will only be generated if the
1468
1520
/// `OnionMessenger` was initialized with
@@ -1768,7 +1820,7 @@ impl Writeable for Event {
1768
1820
BumpTransactionEvent :: HTLCResolution { .. } => { }
1769
1821
}
1770
1822
write_tlv_fields ! ( writer, { } ) ; // Write a length field for forwards compat
1771
- }
1823
+ } ,
1772
1824
& Event :: ChannelReady { ref channel_id, ref user_channel_id, ref counterparty_node_id, ref channel_type } => {
1773
1825
29u8 . write ( writer) ?;
1774
1826
write_tlv_fields ! ( writer, {
@@ -1828,6 +1880,13 @@ impl Writeable for Event {
1828
1880
( 8 , former_temporary_channel_id, required) ,
1829
1881
} ) ;
1830
1882
} ,
1883
+ & Event :: FundingTransactionReadyForSigning { .. } => {
1884
+ 45u8 . write ( writer) ?;
1885
+ // We never write out FundingTransactionReadyForSigning events as, upon disconnection, peers
1886
+ // drop any V2-established channels which have not yet exchanged the initial `commitment_signed`.
1887
+ // We only exhange the initial `commitment_signed` after the client calls
1888
+ // `ChannelManager::funding_transaction_signed` and ALWAYS before we send a `tx_signatures`
1889
+ } ,
1831
1890
// Note that, going forward, all new events must only write data inside of
1832
1891
// `write_tlv_fields`. Versions 0.0.101+ will ignore odd-numbered events that write
1833
1892
// data via `write_tlv_fields`.
0 commit comments