Skip to content

Commit

Permalink
Signer: init protocol initializer earlier
Browse files Browse the repository at this point in the history
So its computed even if an error occur later in the compute signature process.
  • Loading branch information
Alenar committed Jul 12, 2022
1 parent 4649c5a commit 1b4ba34
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mithril-signer/src/single_signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ impl SingleSigner for MithrilSingleSigner {
stakes: Vec<SignerWithStake>, // TODO : use a hmap to prevent party id duplication
protocol_parameters: &entities::ProtocolParameters,
) -> Result<Option<SingleSignatures>, SingleSignerError> {
self.init_protocol_initializer(&stakes, protocol_parameters)?;

let current_signer_with_stake = stakes
.iter()
.find(|s| s.party_id == self.party_id)
Expand All @@ -153,8 +155,6 @@ impl SingleSigner for MithrilSingleSigner {
}
}

self.init_protocol_initializer(&stakes, protocol_parameters)?;

let protocol_signer = self.create_protocol_signer(&stakes)?;

trace!(
Expand Down

0 comments on commit 1b4ba34

Please sign in to comment.