[invoice] Fix non-recoverable sig handling and bogus SI prefix err
[rust-lightning] / lightning-invoice / src / lib.rs
index c3805f91d51636e41529d1104ae20245d469031d..199fbe79a7e90062dfe1ad5b9358294562640570 100644 (file)
@@ -1059,7 +1059,9 @@ impl Invoice {
                match self.signed_invoice.recover_payee_pub_key() {
                        Err(secp256k1::Error::InvalidRecoveryId) =>
                                return Err(SemanticError::InvalidRecoveryId),
-                       Err(_) => panic!("no other error may occur"),
+                       Err(secp256k1::Error::InvalidSignature) =>
+                               return Err(SemanticError::InvalidSignature),
+                       Err(e) => panic!("no other error may occur, got {:?}", e),
                        Ok(_) => {},
                }