Fix verify_messages function (#2074)

* Fix verify_messages function
* Do not use wallet secp to verify messages
This commit is contained in:
Quentin Le Sceller 2018-12-05 13:10:37 -05:00 committed by Ignotus Peverell
parent a717dbad96
commit ed2e1f87aa

View file

@ -46,7 +46,7 @@ use libwallet::types::{
}; };
use libwallet::{Error, ErrorKind}; use libwallet::{Error, ErrorKind};
use util; use util;
use util::secp::pedersen; use util::secp::{self, pedersen};
/// Functions intended for use by the owner (e.g. master seed holder) of the wallet. /// Functions intended for use by the owner (e.g. master seed holder) of the wallet.
pub struct APIOwner<W: ?Sized, C, K> pub struct APIOwner<W: ?Sized, C, K>
@ -730,8 +730,8 @@ where
/// Verifies all messages in the slate match their public keys /// Verifies all messages in the slate match their public keys
pub fn verify_slate_messages(&mut self, slate: &Slate) -> Result<(), Error> { pub fn verify_slate_messages(&mut self, slate: &Slate) -> Result<(), Error> {
let mut w = self.wallet.lock(); let secp = secp::Secp256k1::with_caps(secp::ContextFlag::VerifyOnly);
slate.verify_messages(w.keychain().secp())?; slate.verify_messages(&secp)?;
Ok(()) Ok(())
} }