Skip to content

Commit

Permalink
fix: reverse logic valdiating spentproof shares
Browse files Browse the repository at this point in the history
caught by reviewer of pr 121.

The previous code was only checking that one share matches, not all
shares
  • Loading branch information
dan-da authored and dirvine committed Feb 17, 2022
1 parent 9c64a1d commit b9d2e5c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,18 +264,18 @@ impl ReissueRequestBuilder {
.next()
.ok_or(Error::ReissueRequestMissingSpentProofShare(*input_index))?;

if !shares
if shares
.iter()
.map(SpentProofShare::spentbook_pks)
.any(|pks| pks == any_share.spentbook_pks())
.any(|pks| pks != any_share.spentbook_pks())
{
return Err(Error::ReissueRequestPublicKeySetMismatch);
}

if !shares
if shares
.iter()
.map(|s| &s.public_commitments)
.any(|pc| *pc == any_share.public_commitments)
.any(|pc| *pc != any_share.public_commitments)
{
return Err(Error::ReissueRequestPublicCommitmentMismatch);
}
Expand Down

0 comments on commit b9d2e5c

Please sign in to comment.