@@ -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 } ;
@@ -215,7 +215,7 @@ pub enum HTLCDestination {
215
215
/// counterparty node information.
216
216
node_id : Option < PublicKey > ,
217
217
/// The outgoing `channel_id` between us and the next node.
218
- channel_id : [ u8 ; 32 ] ,
218
+ channel_id : ChannelId ,
219
219
} ,
220
220
/// Scenario where we are unsure of the next node to forward the HTLC to.
221
221
UnknownNextHop {
@@ -333,7 +333,7 @@ pub enum Event {
333
333
/// [`ChannelManager::funding_transaction_generated`].
334
334
///
335
335
/// [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
336
- temporary_channel_id : [ u8 ; 32 ] ,
336
+ temporary_channel_id : ChannelId ,
337
337
/// The counterparty's node_id, which you'll need to pass back into
338
338
/// [`ChannelManager::funding_transaction_generated`].
339
339
///
@@ -423,7 +423,7 @@ pub enum Event {
423
423
/// payment is to pay an invoice or to send a spontaneous payment.
424
424
purpose : PaymentPurpose ,
425
425
/// The `channel_id` indicating over which channel we received the payment.
426
- via_channel_id : Option < [ u8 ; 32 ] > ,
426
+ via_channel_id : Option < ChannelId > ,
427
427
/// The `user_channel_id` indicating over which channel we received the payment.
428
428
via_user_channel_id : Option < u128 > ,
429
429
/// The block height at which this payment will be failed back and will no longer be
@@ -675,10 +675,10 @@ pub enum Event {
675
675
PaymentForwarded {
676
676
/// The incoming channel between the previous node and us. This is only `None` for events
677
677
/// generated or serialized by versions prior to 0.0.107.
678
- prev_channel_id : Option < [ u8 ; 32 ] > ,
678
+ prev_channel_id : Option < ChannelId > ,
679
679
/// The outgoing channel between the next node and us. This is only `None` for events
680
680
/// generated or serialized by versions prior to 0.0.107.
681
- next_channel_id : Option < [ u8 ; 32 ] > ,
681
+ next_channel_id : Option < ChannelId > ,
682
682
/// The fee, in milli-satoshis, which was earned as a result of the payment.
683
683
///
684
684
/// Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
@@ -709,7 +709,7 @@ pub enum Event {
709
709
/// [`Event::ChannelReady`] event.
710
710
ChannelPending {
711
711
/// The `channel_id` of the channel that is pending confirmation.
712
- channel_id : [ u8 ; 32 ] ,
712
+ channel_id : ChannelId ,
713
713
/// The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
714
714
/// channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
715
715
/// [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
@@ -722,7 +722,7 @@ pub enum Event {
722
722
/// The `temporary_channel_id` this channel used to be known by during channel establishment.
723
723
///
724
724
/// Will be `None` for channels created prior to LDK version 0.0.115.
725
- former_temporary_channel_id : Option < [ u8 ; 32 ] > ,
725
+ former_temporary_channel_id : Option < ChannelId > ,
726
726
/// The `node_id` of the channel counterparty.
727
727
counterparty_node_id : PublicKey ,
728
728
/// The outpoint of the channel's funding transaction.
@@ -734,7 +734,7 @@ pub enum Event {
734
734
/// establishment.
735
735
ChannelReady {
736
736
/// The `channel_id` of the channel that is ready.
737
- channel_id : [ u8 ; 32 ] ,
737
+ channel_id : ChannelId ,
738
738
/// The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
739
739
/// channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
740
740
/// [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
@@ -754,7 +754,7 @@ pub enum Event {
754
754
ChannelClosed {
755
755
/// The `channel_id` of the channel which has been closed. Note that on-chain transactions
756
756
/// resolving the channel are likely still awaiting confirmation.
757
- channel_id : [ u8 ; 32 ] ,
757
+ channel_id : ChannelId ,
758
758
/// The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
759
759
/// channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
760
760
/// [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
@@ -781,7 +781,7 @@ pub enum Event {
781
781
/// inputs for another purpose.
782
782
DiscardFunding {
783
783
/// The channel_id of the channel which has been closed.
784
- channel_id : [ u8 ; 32 ] ,
784
+ channel_id : ChannelId ,
785
785
/// The full transaction received from the user
786
786
transaction : Transaction
787
787
} ,
@@ -805,7 +805,7 @@ pub enum Event {
805
805
///
806
806
/// [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
807
807
/// [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
808
- temporary_channel_id : [ u8 ; 32 ] ,
808
+ temporary_channel_id : ChannelId ,
809
809
/// The node_id of the counterparty requesting to open the channel.
810
810
///
811
811
/// When responding to the request, the `counterparty_node_id` should be passed
@@ -851,7 +851,7 @@ pub enum Event {
851
851
/// requirements (i.e. insufficient fees paid, or a CLTV that is too soon).
852
852
HTLCHandlingFailed {
853
853
/// The channel over which the HTLC was received.
854
- prev_channel_id : [ u8 ; 32 ] ,
854
+ prev_channel_id : ChannelId ,
855
855
/// Destination of the HTLC that failed to be processed.
856
856
failed_next_destination : HTLCDestination ,
857
857
} ,
@@ -1272,7 +1272,7 @@ impl MaybeReadable for Event {
1272
1272
} ,
1273
1273
9u8 => {
1274
1274
let f = || {
1275
- let mut channel_id = [ 0 ; 32 ] ;
1275
+ let mut channel_id = ChannelId :: new_zero ( ) ;
1276
1276
let mut reason = UpgradableRequired ( None ) ;
1277
1277
let mut user_channel_id_low_opt: Option < u64 > = None ;
1278
1278
let mut user_channel_id_high_opt: Option < u64 > = None ;
@@ -1300,7 +1300,7 @@ impl MaybeReadable for Event {
1300
1300
} ,
1301
1301
11u8 => {
1302
1302
let f = || {
1303
- let mut channel_id = [ 0 ; 32 ] ;
1303
+ let mut channel_id = ChannelId :: new_zero ( ) ;
1304
1304
let mut transaction = Transaction { version : 2 , lock_time : PackedLockTime :: ZERO , input : Vec :: new ( ) , output : Vec :: new ( ) } ;
1305
1305
read_tlv_fields ! ( reader, {
1306
1306
( 0 , channel_id, required) ,
@@ -1405,7 +1405,7 @@ impl MaybeReadable for Event {
1405
1405
} ,
1406
1406
25u8 => {
1407
1407
let f = || {
1408
- let mut prev_channel_id = [ 0 ; 32 ] ;
1408
+ let mut prev_channel_id = ChannelId :: new_zero ( ) ;
1409
1409
let mut failed_next_destination_opt = UpgradableRequired ( None ) ;
1410
1410
read_tlv_fields ! ( reader, {
1411
1411
( 0 , prev_channel_id, required) ,
@@ -1421,7 +1421,7 @@ impl MaybeReadable for Event {
1421
1421
27u8 => Ok ( None ) ,
1422
1422
29u8 => {
1423
1423
let f = || {
1424
- let mut channel_id = [ 0 ; 32 ] ;
1424
+ let mut channel_id = ChannelId :: new_zero ( ) ;
1425
1425
let mut user_channel_id: u128 = 0 ;
1426
1426
let mut counterparty_node_id = RequiredWrapper ( None ) ;
1427
1427
let mut channel_type = RequiredWrapper ( None ) ;
@@ -1443,7 +1443,7 @@ impl MaybeReadable for Event {
1443
1443
} ,
1444
1444
31u8 => {
1445
1445
let f = || {
1446
- let mut channel_id = [ 0 ; 32 ] ;
1446
+ let mut channel_id = ChannelId :: new_zero ( ) ;
1447
1447
let mut user_channel_id: u128 = 0 ;
1448
1448
let mut former_temporary_channel_id = None ;
1449
1449
let mut counterparty_node_id = RequiredWrapper ( None ) ;
0 commit comments