File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ use bitcoin::hashes::sha256d::Hash as Sha256dHash;
2525use bitcoin:: hash_types:: WPubkeyHash ;
2626
2727use bitcoin:: secp256k1:: key:: { SecretKey , PublicKey } ;
28- use bitcoin:: secp256k1:: { Message , Secp256k1 , Signature , Signing } ;
28+ use bitcoin:: secp256k1:: { Secp256k1 , Signature , Signing } ;
2929use bitcoin:: secp256k1:: recovery:: RecoverableSignature ;
3030use bitcoin:: secp256k1;
3131
@@ -1056,12 +1056,7 @@ impl KeysInterface for KeysManager {
10561056 }
10571057
10581058 fn sign_invoice ( & self , invoice_preimage : Vec < u8 > ) -> Result < RecoverableSignature , ( ) > {
1059- let secp_ctx = Secp256k1 :: new ( ) ;
1060- let mut raw_hash: [ u8 ; 32 ] = Default :: default ( ) ;
1061- raw_hash. copy_from_slice ( & Sha256 :: hash ( & invoice_preimage) [ ..] ) ;
1062- let msg_hash = Message :: from_slice ( & raw_hash[ ..] )
1063- . expect ( "Hash is 32 bytes long, same as MESSAGE_SIZE" ) ;
1064- Ok ( secp_ctx. sign_recoverable ( & msg_hash, & self . get_node_secret ( ) ) )
1059+ Ok ( self . secp_ctx . sign_recoverable ( & hash_to_message ! ( & Sha256 :: hash( & invoice_preimage) ) , & self . get_node_secret ( ) ) )
10651060 }
10661061}
10671062
You can’t perform that action at this time.
0 commit comments