@@ -20,7 +20,7 @@ pub use bump_transaction::BumpTransactionEvent;
2020
2121use crate :: sign:: SpendableOutputDescriptor ;
2222use crate :: ln:: channelmanager:: { InterceptId , PaymentId , RecipientOnionFields } ;
23- use crate :: ln:: channel:: FUNDING_CONF_DEADLINE_BLOCKS ;
23+ use crate :: ln:: channel:: { ChannelId , FUNDING_CONF_DEADLINE_BLOCKS } ;
2424use crate :: ln:: features:: ChannelTypeFeatures ;
2525use crate :: ln:: msgs;
2626use crate :: ln:: { PaymentPreimage , PaymentHash , PaymentSecret } ;
@@ -83,7 +83,7 @@ impl_writeable_tlv_based_enum!(PaymentPurpose,
8383#[ derive( Clone , Debug , PartialEq , Eq ) ]
8484pub struct ClaimedHTLC {
8585 /// The `channel_id` of the channel over which the HTLC was received.
86- pub channel_id : [ u8 ; 32 ] ,
86+ pub channel_id : ChannelId ,
8787 /// The `user_channel_id` of the channel over which the HTLC was received. This is the value
8888 /// passed in to [`ChannelManager::create_channel`] for outbound channels, or to
8989 /// [`ChannelManager::accept_inbound_channel`] for inbound channels if
@@ -246,7 +246,7 @@ pub enum HTLCDestination {
246246 /// counterparty node information.
247247 node_id : Option < PublicKey > ,
248248 /// The outgoing `channel_id` between us and the next node.
249- channel_id : [ u8 ; 32 ] ,
249+ channel_id : ChannelId ,
250250 } ,
251251 /// Scenario where we are unsure of the next node to forward the HTLC to.
252252 UnknownNextHop {
@@ -364,7 +364,7 @@ pub enum Event {
364364 /// [`ChannelManager::funding_transaction_generated`].
365365 ///
366366 /// [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
367- temporary_channel_id : [ u8 ; 32 ] ,
367+ temporary_channel_id : ChannelId ,
368368 /// The counterparty's node_id, which you'll need to pass back into
369369 /// [`ChannelManager::funding_transaction_generated`].
370370 ///
@@ -458,7 +458,7 @@ pub enum Event {
458458 /// payment is to pay an invoice or to send a spontaneous payment.
459459 purpose : PaymentPurpose ,
460460 /// The `channel_id` indicating over which channel we received the payment.
461- via_channel_id : Option < [ u8 ; 32 ] > ,
461+ via_channel_id : Option < ChannelId > ,
462462 /// The `user_channel_id` indicating over which channel we received the payment.
463463 via_user_channel_id : Option < u128 > ,
464464 /// The block height at which this payment will be failed back and will no longer be
@@ -721,10 +721,10 @@ pub enum Event {
721721 PaymentForwarded {
722722 /// The incoming channel between the previous node and us. This is only `None` for events
723723 /// generated or serialized by versions prior to 0.0.107.
724- prev_channel_id : Option < [ u8 ; 32 ] > ,
724+ prev_channel_id : Option < ChannelId > ,
725725 /// The outgoing channel between the next node and us. This is only `None` for events
726726 /// generated or serialized by versions prior to 0.0.107.
727- next_channel_id : Option < [ u8 ; 32 ] > ,
727+ next_channel_id : Option < ChannelId > ,
728728 /// The fee, in milli-satoshis, which was earned as a result of the payment.
729729 ///
730730 /// Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
@@ -755,7 +755,7 @@ pub enum Event {
755755 /// [`Event::ChannelReady`] event.
756756 ChannelPending {
757757 /// The `channel_id` of the channel that is pending confirmation.
758- channel_id : [ u8 ; 32 ] ,
758+ channel_id : ChannelId ,
759759 /// The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
760760 /// channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
761761 /// [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
@@ -768,7 +768,7 @@ pub enum Event {
768768 /// The `temporary_channel_id` this channel used to be known by during channel establishment.
769769 ///
770770 /// Will be `None` for channels created prior to LDK version 0.0.115.
771- former_temporary_channel_id : Option < [ u8 ; 32 ] > ,
771+ former_temporary_channel_id : Option < ChannelId > ,
772772 /// The `node_id` of the channel counterparty.
773773 counterparty_node_id : PublicKey ,
774774 /// The outpoint of the channel's funding transaction.
@@ -780,7 +780,7 @@ pub enum Event {
780780 /// establishment.
781781 ChannelReady {
782782 /// The `channel_id` of the channel that is ready.
783- channel_id : [ u8 ; 32 ] ,
783+ channel_id : ChannelId ,
784784 /// The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
785785 /// channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
786786 /// [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
@@ -807,7 +807,7 @@ pub enum Event {
807807 ChannelClosed {
808808 /// The `channel_id` of the channel which has been closed. Note that on-chain transactions
809809 /// resolving the channel are likely still awaiting confirmation.
810- channel_id : [ u8 ; 32 ] ,
810+ channel_id : ChannelId ,
811811 /// The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
812812 /// channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
813813 /// [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
@@ -834,7 +834,7 @@ pub enum Event {
834834 /// inputs for another purpose.
835835 DiscardFunding {
836836 /// The channel_id of the channel which has been closed.
837- channel_id : [ u8 ; 32 ] ,
837+ channel_id : ChannelId ,
838838 /// The full transaction received from the user
839839 transaction : Transaction
840840 } ,
@@ -859,7 +859,7 @@ pub enum Event {
859859 ///
860860 /// [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
861861 /// [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
862- temporary_channel_id : [ u8 ; 32 ] ,
862+ temporary_channel_id : ChannelId ,
863863 /// The node_id of the counterparty requesting to open the channel.
864864 ///
865865 /// When responding to the request, the `counterparty_node_id` should be passed
@@ -905,7 +905,7 @@ pub enum Event {
905905 /// requirements (i.e. insufficient fees paid, or a CLTV that is too soon).
906906 HTLCHandlingFailed {
907907 /// The channel over which the HTLC was received.
908- prev_channel_id : [ u8 ; 32 ] ,
908+ prev_channel_id : ChannelId ,
909909 /// Destination of the HTLC that failed to be processed.
910910 failed_next_destination : HTLCDestination ,
911911 } ,
@@ -1328,7 +1328,7 @@ impl MaybeReadable for Event {
13281328 } ,
13291329 9u8 => {
13301330 let f = || {
1331- let mut channel_id = [ 0 ; 32 ] ;
1331+ let mut channel_id = ChannelId :: new_zero ( ) ;
13321332 let mut reason = UpgradableRequired ( None ) ;
13331333 let mut user_channel_id_low_opt: Option < u64 > = None ;
13341334 let mut user_channel_id_high_opt: Option < u64 > = None ;
@@ -1356,7 +1356,7 @@ impl MaybeReadable for Event {
13561356 } ,
13571357 11u8 => {
13581358 let f = || {
1359- let mut channel_id = [ 0 ; 32 ] ;
1359+ let mut channel_id = ChannelId :: new_zero ( ) ;
13601360 let mut transaction = Transaction { version : 2 , lock_time : PackedLockTime :: ZERO , input : Vec :: new ( ) , output : Vec :: new ( ) } ;
13611361 read_tlv_fields ! ( reader, {
13621362 ( 0 , channel_id, required) ,
@@ -1467,7 +1467,7 @@ impl MaybeReadable for Event {
14671467 } ,
14681468 25u8 => {
14691469 let f = || {
1470- let mut prev_channel_id = [ 0 ; 32 ] ;
1470+ let mut prev_channel_id = ChannelId :: new_zero ( ) ;
14711471 let mut failed_next_destination_opt = UpgradableRequired ( None ) ;
14721472 read_tlv_fields ! ( reader, {
14731473 ( 0 , prev_channel_id, required) ,
@@ -1483,7 +1483,7 @@ impl MaybeReadable for Event {
14831483 27u8 => Ok ( None ) ,
14841484 29u8 => {
14851485 let f = || {
1486- let mut channel_id = [ 0 ; 32 ] ;
1486+ let mut channel_id = ChannelId :: new_zero ( ) ;
14871487 let mut user_channel_id: u128 = 0 ;
14881488 let mut counterparty_node_id = RequiredWrapper ( None ) ;
14891489 let mut channel_type = RequiredWrapper ( None ) ;
@@ -1505,7 +1505,7 @@ impl MaybeReadable for Event {
15051505 } ,
15061506 31u8 => {
15071507 let f = || {
1508- let mut channel_id = [ 0 ; 32 ] ;
1508+ let mut channel_id = ChannelId :: new_zero ( ) ;
15091509 let mut user_channel_id: u128 = 0 ;
15101510 let mut former_temporary_channel_id = None ;
15111511 let mut counterparty_node_id = RequiredWrapper ( None ) ;
0 commit comments