Skip to content

Commit de2627d

Browse files
authored
Merge pull request #7101 from multiversx/do-not-vote-on-closed-proposal
do not vote on closed proposal
2 parents 0fd6812 + cc5deca commit de2627d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

vm/systemSmartContracts/governance.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1266,7 +1266,7 @@ func (g *governanceContract) saveGeneralProposal(reference []byte, generalPropos
12661266
return nil
12671267
}
12681268

1269-
// getValidProposal returns a proposal from storage if it exists, or it is still valid/in-progress
1269+
// getValidProposal returns a proposal from storage if it exists and it is still valid/in-progress
12701270
func (g *governanceContract) getValidProposal(nonce *big.Int) (*GeneralProposal, error) {
12711271
proposal, err := g.getProposalFromNonce(nonce)
12721272
if err != nil {
@@ -1282,6 +1282,10 @@ func (g *governanceContract) getValidProposal(nonce *big.Int) (*GeneralProposal,
12821282
return nil, vm.ErrVotedForAnExpiredProposal
12831283
}
12841284

1285+
if proposal.Closed {
1286+
return nil, vm.ErrVotedForAnExpiredProposal
1287+
}
1288+
12851289
return proposal, nil
12861290
}
12871291

0 commit comments

Comments
 (0)