Fix issue with wrong merit

- We need to ignore the compensationProposal from the current cycle
when creating the merit list
This commit is contained in:
Manfred Karrer 2018-09-24 19:14:44 -05:00
parent ee1317c64a
commit d9cada9ec0
No known key found for this signature in database
GPG Key ID: 401250966A6B2C46

View File

@ -271,10 +271,11 @@ public class MyBlindVoteListService implements PersistedDataHost, BsqStateListen
// blindVoteTxId is null if we use the method from the getCurrentlyAvailableMerit call.
public MeritList getMerits(@Nullable String blindVoteTxId) {
// Create a lookup set for txIds of own comp. requests
// Create a lookup set for txIds of own comp. requests from past cycles (we ignore request form that cycle)
Set<String> myCompensationProposalTxIs = myProposalListService.getList().stream()
.filter(proposal -> proposal instanceof CompensationProposal)
.map(Proposal::getTxId)
.filter(txId -> periodService.isTxInPastCycle(txId, periodService.getChainHeight()))
.collect(Collectors.toSet());
return new MeritList(bsqStateService.getIssuanceSet().stream()