@@ -20,7 +20,7 @@ pub use bump_transaction::BumpTransactionEvent;
20
20
21
21
use crate :: sign:: SpendableOutputDescriptor ;
22
22
use 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 } ;
24
24
use crate :: ln:: features:: ChannelTypeFeatures ;
25
25
use crate :: ln:: msgs;
26
26
use crate :: ln:: { PaymentPreimage , PaymentHash , PaymentSecret } ;
@@ -83,7 +83,7 @@ impl_writeable_tlv_based_enum!(PaymentPurpose,
83
83
#[ derive( Clone , Debug , PartialEq , Eq ) ]
84
84
pub struct ClaimedHTLC {
85
85
/// The `channel_id` of the channel over which the HTLC was received.
86
- pub channel_id : [ u8 ; 32 ] ,
86
+ pub channel_id : ChannelId ,
87
87
/// The `user_channel_id` of the channel over which the HTLC was received. This is the value
88
88
/// passed in to [`ChannelManager::create_channel`] for outbound channels, or to
89
89
/// [`ChannelManager::accept_inbound_channel`] for inbound channels if
@@ -246,7 +246,7 @@ pub enum HTLCDestination {
246
246
/// counterparty node information.
247
247
node_id : Option < PublicKey > ,
248
248
/// The outgoing `channel_id` between us and the next node.
249
- channel_id : [ u8 ; 32 ] ,
249
+ channel_id : ChannelId ,
250
250
} ,
251
251
/// Scenario where we are unsure of the next node to forward the HTLC to.
252
252
UnknownNextHop {
@@ -364,7 +364,7 @@ pub enum Event {
364
364
/// [`ChannelManager::funding_transaction_generated`].
365
365
///
366
366
/// [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
367
- temporary_channel_id : [ u8 ; 32 ] ,
367
+ temporary_channel_id : ChannelId ,
368
368
/// The counterparty's node_id, which you'll need to pass back into
369
369
/// [`ChannelManager::funding_transaction_generated`].
370
370
///
@@ -458,7 +458,7 @@ pub enum Event {
458
458
/// payment is to pay an invoice or to send a spontaneous payment.
459
459
purpose : PaymentPurpose ,
460
460
/// The `channel_id` indicating over which channel we received the payment.
461
- via_channel_id : Option < [ u8 ; 32 ] > ,
461
+ via_channel_id : Option < ChannelId > ,
462
462
/// The `user_channel_id` indicating over which channel we received the payment.
463
463
via_user_channel_id : Option < u128 > ,
464
464
/// The block height at which this payment will be failed back and will no longer be
@@ -721,10 +721,10 @@ pub enum Event {
721
721
PaymentForwarded {
722
722
/// The incoming channel between the previous node and us. This is only `None` for events
723
723
/// generated or serialized by versions prior to 0.0.107.
724
- prev_channel_id : Option < [ u8 ; 32 ] > ,
724
+ prev_channel_id : Option < ChannelId > ,
725
725
/// The outgoing channel between the next node and us. This is only `None` for events
726
726
/// generated or serialized by versions prior to 0.0.107.
727
- next_channel_id : Option < [ u8 ; 32 ] > ,
727
+ next_channel_id : Option < ChannelId > ,
728
728
/// The fee, in milli-satoshis, which was earned as a result of the payment.
729
729
///
730
730
/// Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
@@ -755,7 +755,7 @@ pub enum Event {
755
755
/// [`Event::ChannelReady`] event.
756
756
ChannelPending {
757
757
/// The `channel_id` of the channel that is pending confirmation.
758
- channel_id : [ u8 ; 32 ] ,
758
+ channel_id : ChannelId ,
759
759
/// The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
760
760
/// channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
761
761
/// [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
@@ -768,7 +768,7 @@ pub enum Event {
768
768
/// The `temporary_channel_id` this channel used to be known by during channel establishment.
769
769
///
770
770
/// 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 > ,
772
772
/// The `node_id` of the channel counterparty.
773
773
counterparty_node_id : PublicKey ,
774
774
/// The outpoint of the channel's funding transaction.
@@ -780,7 +780,7 @@ pub enum Event {
780
780
/// establishment.
781
781
ChannelReady {
782
782
/// The `channel_id` of the channel that is ready.
783
- channel_id : [ u8 ; 32 ] ,
783
+ channel_id : ChannelId ,
784
784
/// The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
785
785
/// channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
786
786
/// [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
@@ -807,7 +807,7 @@ pub enum Event {
807
807
ChannelClosed {
808
808
/// The `channel_id` of the channel which has been closed. Note that on-chain transactions
809
809
/// resolving the channel are likely still awaiting confirmation.
810
- channel_id : [ u8 ; 32 ] ,
810
+ channel_id : ChannelId ,
811
811
/// The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
812
812
/// channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
813
813
/// [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
@@ -834,7 +834,7 @@ pub enum Event {
834
834
/// inputs for another purpose.
835
835
DiscardFunding {
836
836
/// The channel_id of the channel which has been closed.
837
- channel_id : [ u8 ; 32 ] ,
837
+ channel_id : ChannelId ,
838
838
/// The full transaction received from the user
839
839
transaction : Transaction
840
840
} ,
@@ -859,7 +859,7 @@ pub enum Event {
859
859
///
860
860
/// [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
861
861
/// [`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 ,
863
863
/// The node_id of the counterparty requesting to open the channel.
864
864
///
865
865
/// When responding to the request, the `counterparty_node_id` should be passed
@@ -905,7 +905,7 @@ pub enum Event {
905
905
/// requirements (i.e. insufficient fees paid, or a CLTV that is too soon).
906
906
HTLCHandlingFailed {
907
907
/// The channel over which the HTLC was received.
908
- prev_channel_id : [ u8 ; 32 ] ,
908
+ prev_channel_id : ChannelId ,
909
909
/// Destination of the HTLC that failed to be processed.
910
910
failed_next_destination : HTLCDestination ,
911
911
} ,
@@ -1328,7 +1328,7 @@ impl MaybeReadable for Event {
1328
1328
} ,
1329
1329
9u8 => {
1330
1330
let f = || {
1331
- let mut channel_id = [ 0 ; 32 ] ;
1331
+ let mut channel_id = ChannelId :: new_zero ( ) ;
1332
1332
let mut reason = UpgradableRequired ( None ) ;
1333
1333
let mut user_channel_id_low_opt: Option < u64 > = None ;
1334
1334
let mut user_channel_id_high_opt: Option < u64 > = None ;
@@ -1356,7 +1356,7 @@ impl MaybeReadable for Event {
1356
1356
} ,
1357
1357
11u8 => {
1358
1358
let f = || {
1359
- let mut channel_id = [ 0 ; 32 ] ;
1359
+ let mut channel_id = ChannelId :: new_zero ( ) ;
1360
1360
let mut transaction = Transaction { version : 2 , lock_time : PackedLockTime :: ZERO , input : Vec :: new ( ) , output : Vec :: new ( ) } ;
1361
1361
read_tlv_fields ! ( reader, {
1362
1362
( 0 , channel_id, required) ,
@@ -1467,7 +1467,7 @@ impl MaybeReadable for Event {
1467
1467
} ,
1468
1468
25u8 => {
1469
1469
let f = || {
1470
- let mut prev_channel_id = [ 0 ; 32 ] ;
1470
+ let mut prev_channel_id = ChannelId :: new_zero ( ) ;
1471
1471
let mut failed_next_destination_opt = UpgradableRequired ( None ) ;
1472
1472
read_tlv_fields ! ( reader, {
1473
1473
( 0 , prev_channel_id, required) ,
@@ -1483,7 +1483,7 @@ impl MaybeReadable for Event {
1483
1483
27u8 => Ok ( None ) ,
1484
1484
29u8 => {
1485
1485
let f = || {
1486
- let mut channel_id = [ 0 ; 32 ] ;
1486
+ let mut channel_id = ChannelId :: new_zero ( ) ;
1487
1487
let mut user_channel_id: u128 = 0 ;
1488
1488
let mut counterparty_node_id = RequiredWrapper ( None ) ;
1489
1489
let mut channel_type = RequiredWrapper ( None ) ;
@@ -1505,7 +1505,7 @@ impl MaybeReadable for Event {
1505
1505
} ,
1506
1506
31u8 => {
1507
1507
let f = || {
1508
- let mut channel_id = [ 0 ; 32 ] ;
1508
+ let mut channel_id = ChannelId :: new_zero ( ) ;
1509
1509
let mut user_channel_id: u128 = 0 ;
1510
1510
let mut former_temporary_channel_id = None ;
1511
1511
let mut counterparty_node_id = RequiredWrapper ( None ) ;
0 commit comments