Skip to content

Commit 91a60c8

Browse files
committed
impl Borrow<[u8]> for ChannelId
We do this for `Payment*` in `lightning-types` and its needed for the `hex_conservaitve` `impl_fmt_traits` macro which we'll use in the next commit.
1 parent eba329c commit 91a60c8

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7135,7 +7135,7 @@ where
71357135
chan
71367136
} else {
71377137
let update_actions = peer_state.monitor_update_blocked_actions
7138-
.remove(&channel_id).unwrap_or(Vec::new());
7138+
.remove(channel_id).unwrap_or(Vec::new());
71397139
mem::drop(peer_state_lock);
71407140
mem::drop(per_peer_state);
71417141
self.handle_monitor_update_completion_actions(update_actions);

lightning/src/ln/types.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ use bitcoin::hashes::{
3030
HashEngine as _,
3131
sha256::Hash as Sha256,
3232
};
33+
use core::borrow::Borrow;
3334
use core::fmt;
3435
use core::ops::Deref;
3536

@@ -127,6 +128,12 @@ impl fmt::Display for ChannelId {
127128
}
128129
}
129130

131+
impl Borrow<[u8]> for ChannelId {
132+
fn borrow(&self) -> &[u8] {
133+
&self.0[..]
134+
}
135+
}
136+
130137
pub use lightning_types::payment::{PaymentHash, PaymentPreimage, PaymentSecret};
131138

132139
#[cfg(test)]

0 commit comments

Comments
 (0)