File tree 1 file changed +9
-0
lines changed
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ pub mod channel;
34
34
#[ cfg( not( fuzzing) ) ]
35
35
pub ( crate ) mod channel;
36
36
37
+ use bitcoin:: secp256k1:: ThirtyTwoByteHash ;
37
38
// Re-export ChannelId
38
39
pub use channel_id:: ChannelId ;
39
40
@@ -85,6 +86,8 @@ mod offers_tests;
85
86
86
87
pub use self :: peer_channel_encryptor:: LN_MAX_MSG_LEN ;
87
88
89
+ use bitcoin:: hashes:: { sha256:: Hash as Sha256 , Hash } ;
90
+
88
91
/// payment_hash type, use to cross-lock hop
89
92
///
90
93
/// This is not exported to bindings users as we just use [u8; 32] directly
@@ -109,6 +112,12 @@ impl core::fmt::Display for PaymentPreimage {
109
112
}
110
113
}
111
114
115
+ impl Into < PaymentHash > for PaymentPreimage {
116
+ fn into ( self ) -> PaymentHash {
117
+ PaymentHash ( Sha256 :: hash ( & self . 0 ) . into_32 ( ) )
118
+ }
119
+ }
120
+
112
121
/// payment_secret type, use to authenticate sender to the receiver and tie MPP HTLCs together
113
122
///
114
123
/// This is not exported to bindings users as we just use [u8; 32] directly
You can’t perform that action at this time.
0 commit comments