Process received commitments to the shares from another party and store it
(
&mut self,
sender_id: ParticipantId,
commitments: Commitments,
)
| 63 | |
| 64 | /// Process received commitments to the shares from another party and store it |
| 65 | pub fn receive_commitment( |
| 66 | &mut self, |
| 67 | sender_id: ParticipantId, |
| 68 | commitments: Commitments, |
| 69 | ) -> Result<(), OTError> { |
| 70 | if !self.cointoss_protocols.contains_key(&sender_id) { |
| 71 | return Err(OTError::UnexpectedParticipant(sender_id)); |
| 72 | } |
| 73 | let protocol = self.cointoss_protocols.get_mut(&sender_id).unwrap(); |
| 74 | protocol.receive_commitment(sender_id, commitments)?; |
| 75 | Ok(()) |
| 76 | } |
| 77 | |
| 78 | /// Process a received share from another party, verify it against the commitment receiver earlier |
| 79 | /// and store the shares |