@@ -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
///
@@ -411,7 +411,7 @@ pub enum Event {
411
411
/// payment is to pay an invoice or to send a spontaneous payment.
412
412
purpose : PaymentPurpose ,
413
413
/// The `channel_id` indicating over which channel we received the payment.
414
- via_channel_id : Option < [ u8 ; 32 ] > ,
414
+ via_channel_id : Option < ChannelId > ,
415
415
/// The `user_channel_id` indicating over which channel we received the payment.
416
416
via_user_channel_id : Option < u128 > ,
417
417
/// The block height at which this payment will be failed back and will no longer be
@@ -663,10 +663,10 @@ pub enum Event {
663
663
PaymentForwarded {
664
664
/// The incoming channel between the previous node and us. This is only `None` for events
665
665
/// generated or serialized by versions prior to 0.0.107.
666
- prev_channel_id : Option < [ u8 ; 32 ] > ,
666
+ prev_channel_id : Option < ChannelId > ,
667
667
/// The outgoing channel between the next node and us. This is only `None` for events
668
668
/// generated or serialized by versions prior to 0.0.107.
669
- next_channel_id : Option < [ u8 ; 32 ] > ,
669
+ next_channel_id : Option < ChannelId > ,
670
670
/// The fee, in milli-satoshis, which was earned as a result of the payment.
671
671
///
672
672
/// Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
@@ -697,7 +697,7 @@ pub enum Event {
697
697
/// [`Event::ChannelReady`] event.
698
698
ChannelPending {
699
699
/// The `channel_id` of the channel that is pending confirmation.
700
- channel_id : [ u8 ; 32 ] ,
700
+ channel_id : ChannelId ,
701
701
/// The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
702
702
/// channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
703
703
/// [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
@@ -710,7 +710,7 @@ pub enum Event {
710
710
/// The `temporary_channel_id` this channel used to be known by during channel establishment.
711
711
///
712
712
/// Will be `None` for channels created prior to LDK version 0.0.115.
713
- former_temporary_channel_id : Option < [ u8 ; 32 ] > ,
713
+ former_temporary_channel_id : Option < ChannelId > ,
714
714
/// The `node_id` of the channel counterparty.
715
715
counterparty_node_id : PublicKey ,
716
716
/// The outpoint of the channel's funding transaction.
@@ -722,7 +722,7 @@ pub enum Event {
722
722
/// establishment.
723
723
ChannelReady {
724
724
/// The `channel_id` of the channel that is ready.
725
- channel_id : [ u8 ; 32 ] ,
725
+ channel_id : ChannelId ,
726
726
/// The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
727
727
/// channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
728
728
/// [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
@@ -742,7 +742,7 @@ pub enum Event {
742
742
ChannelClosed {
743
743
/// The `channel_id` of the channel which has been closed. Note that on-chain transactions
744
744
/// resolving the channel are likely still awaiting confirmation.
745
- channel_id : [ u8 ; 32 ] ,
745
+ channel_id : ChannelId ,
746
746
/// The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
747
747
/// channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
748
748
/// [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
@@ -761,7 +761,7 @@ pub enum Event {
761
761
/// inputs for another purpose.
762
762
DiscardFunding {
763
763
/// The channel_id of the channel which has been closed.
764
- channel_id : [ u8 ; 32 ] ,
764
+ channel_id : ChannelId ,
765
765
/// The full transaction received from the user
766
766
transaction : Transaction
767
767
} ,
@@ -785,7 +785,7 @@ pub enum Event {
785
785
///
786
786
/// [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
787
787
/// [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
788
- temporary_channel_id : [ u8 ; 32 ] ,
788
+ temporary_channel_id : ChannelId ,
789
789
/// The node_id of the counterparty requesting to open the channel.
790
790
///
791
791
/// When responding to the request, the `counterparty_node_id` should be passed
@@ -831,7 +831,7 @@ pub enum Event {
831
831
/// requirements (i.e. insufficient fees paid, or a CLTV that is too soon).
832
832
HTLCHandlingFailed {
833
833
/// The channel over which the HTLC was received.
834
- prev_channel_id : [ u8 ; 32 ] ,
834
+ prev_channel_id : ChannelId ,
835
835
/// Destination of the HTLC that failed to be processed.
836
836
failed_next_destination : HTLCDestination ,
837
837
} ,
@@ -1248,7 +1248,7 @@ impl MaybeReadable for Event {
1248
1248
} ,
1249
1249
9u8 => {
1250
1250
let f = || {
1251
- let mut channel_id = [ 0 ; 32 ] ;
1251
+ let mut channel_id = ChannelId :: new_zero ( ) ;
1252
1252
let mut reason = UpgradableRequired ( None ) ;
1253
1253
let mut user_channel_id_low_opt: Option < u64 > = None ;
1254
1254
let mut user_channel_id_high_opt: Option < u64 > = None ;
@@ -1271,7 +1271,7 @@ impl MaybeReadable for Event {
1271
1271
} ,
1272
1272
11u8 => {
1273
1273
let f = || {
1274
- let mut channel_id = [ 0 ; 32 ] ;
1274
+ let mut channel_id = ChannelId :: new_zero ( ) ;
1275
1275
let mut transaction = Transaction { version : 2 , lock_time : PackedLockTime :: ZERO , input : Vec :: new ( ) , output : Vec :: new ( ) } ;
1276
1276
read_tlv_fields ! ( reader, {
1277
1277
( 0 , channel_id, required) ,
@@ -1376,7 +1376,7 @@ impl MaybeReadable for Event {
1376
1376
} ,
1377
1377
25u8 => {
1378
1378
let f = || {
1379
- let mut prev_channel_id = [ 0 ; 32 ] ;
1379
+ let mut prev_channel_id = ChannelId :: new_zero ( ) ;
1380
1380
let mut failed_next_destination_opt = UpgradableRequired ( None ) ;
1381
1381
read_tlv_fields ! ( reader, {
1382
1382
( 0 , prev_channel_id, required) ,
@@ -1392,7 +1392,7 @@ impl MaybeReadable for Event {
1392
1392
27u8 => Ok ( None ) ,
1393
1393
29u8 => {
1394
1394
let f = || {
1395
- let mut channel_id = [ 0 ; 32 ] ;
1395
+ let mut channel_id = ChannelId :: new_zero ( ) ;
1396
1396
let mut user_channel_id: u128 = 0 ;
1397
1397
let mut counterparty_node_id = RequiredWrapper ( None ) ;
1398
1398
let mut channel_type = RequiredWrapper ( None ) ;
@@ -1414,7 +1414,7 @@ impl MaybeReadable for Event {
1414
1414
} ,
1415
1415
31u8 => {
1416
1416
let f = || {
1417
- let mut channel_id = [ 0 ; 32 ] ;
1417
+ let mut channel_id = ChannelId :: new_zero ( ) ;
1418
1418
let mut user_channel_id: u128 = 0 ;
1419
1419
let mut former_temporary_channel_id = None ;
1420
1420
let mut counterparty_node_id = RequiredWrapper ( None ) ;
0 commit comments