Skip to content

Commit ce9f6de

Browse files
committed
Limit the maximum number of proposal groups
1 parent b32ba82 commit ce9f6de

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

internal/app/engine/process_proposals.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import (
88
"time"
99
)
1010

11+
const maxProposals = 5
12+
1113
func (e *Engine) processProposals() {
1214

1315
now := e.timeProvider()
@@ -38,6 +40,11 @@ func (e *Engine) processProposals() {
3840
})
3941
}
4042
}
43+
44+
diff := len(e.currentState.ProposalGroups) - maxProposals
45+
if diff > 0 {
46+
e.currentState.ProposalGroups = e.currentState.ProposalGroups[diff:]
47+
}
4148
}
4249

4350
func uniqueOrigins(group *state.ProposalGroup) int {

0 commit comments

Comments
 (0)