Skip to content

Commit

Permalink
fix(PoH): processVouches indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
unknownunknown1 committed Sep 1, 2024
1 parent bab5585 commit 3e69046
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions contracts/ProofOfHumanity.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1215,8 +1215,8 @@ contract ProofOfHumanity is IProofOfHumanity, IArbitrable, IEvidence {

if (applyPenalty) {
// Situation when vouching address is in the middle of renewal process.
uint256 voucherRequestId = voucherHumanity.requestCount[voucherHumanity.owner] - 1;
if (voucherRequestId != 0) voucherHumanity.requests[voucherRequestId].punishedVouch = true;
uint256 voucherRequestCount = voucherHumanity.requestCount[voucherHumanity.owner];
if (voucherRequestCount != 0) voucherHumanity.requests[voucherRequestCount - 1].punishedVouch = true;

delete voucherHumanity.owner;

Expand Down
4 changes: 2 additions & 2 deletions contracts/extending-old/ProofOfHumanityExtended.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1250,8 +1250,8 @@ contract ProofOfHumanityExtended is IProofOfHumanity, IArbitrable, IEvidence {
if (applyPenalty) {
// Situation when vouching address is in the middle of renewal process.
if (voucherHumanity.owner != address(0x0) && block.timestamp < voucherHumanity.expirationTime) {
uint256 voucherRequestId = voucherHumanity.requestCount[voucherHumanity.owner] - 1;
if (voucherRequestId != 0) voucherHumanity.requests[voucherRequestId].punishedVouch = true;
uint256 voucherRequestCount = voucherHumanity.requestCount[voucherHumanity.owner];
if (voucherRequestCount != 0) voucherHumanity.requests[voucherRequestCount - 1].punishedVouch = true;

delete voucherHumanity.owner;

Expand Down

0 comments on commit 3e69046

Please sign in to comment.