Skip to content

Commit a545683

Browse files
committed
Add Display to PaymentHash
1 parent 8f02430 commit a545683

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lightning/src/ln/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ pub use self::peer_channel_encryptor::LN_MAX_MSG_LEN;
7474
/// This is not exported to bindings users as we just use [u8; 32] directly
7575
#[derive(Hash, Copy, Clone, PartialEq, Eq, Debug, Ord, PartialOrd)]
7676
pub struct PaymentHash(pub [u8; 32]);
77+
78+
impl core::fmt::Display for PaymentHash {
79+
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
80+
crate::util::logger::DebugBytes(&self.0).fmt(f)
81+
}
82+
}
83+
7784
/// payment_preimage type, use to route payment between hop
7885
///
7986
/// This is not exported to bindings users as we just use [u8; 32] directly

0 commit comments

Comments
 (0)