Refactor: Move code for adding decryptedBallotsWithMeritsSet to daoStateService

This commit is contained in:
Manfred Karrer 2019-02-05 13:41:15 +01:00
parent 5702ab03cc
commit 076e3faf95
No known key found for this signature in database
GPG key ID: 401250966A6B2C46
2 changed files with 8 additions and 3 deletions

View file

@ -176,9 +176,7 @@ public class VoteResultService implements DaoStateListener, DaoSetupService {
long startTs = System.currentTimeMillis();
Set<DecryptedBallotsWithMerits> decryptedBallotsWithMeritsSet = getDecryptedBallotsWithMeritsSet(chainHeight);
decryptedBallotsWithMeritsSet.stream()
.filter(e -> !daoStateService.getDecryptedBallotsWithMeritsList().contains(e))
.forEach(daoStateService.getDecryptedBallotsWithMeritsList()::add);
daoStateService.addAllDecryptedBallotsWithMeritsList(decryptedBallotsWithMeritsSet);
if (!decryptedBallotsWithMeritsSet.isEmpty()) {
// From the decryptedBallotsWithMerits we create a map with the hash of the blind vote list as key and the

View file

@ -912,6 +912,13 @@ public class DaoStateService implements DaoSetupService {
return daoState.getDecryptedBallotsWithMeritsList();
}
public void addAllDecryptedBallotsWithMeritsList(Set<DecryptedBallotsWithMerits> decryptedBallotsWithMeritsSet) {
decryptedBallotsWithMeritsSet.stream()
.filter(e -> !daoState.getDecryptedBallotsWithMeritsList().contains(e))
.forEach(daoState.getDecryptedBallotsWithMeritsList()::add);
}
///////////////////////////////////////////////////////////////////////////////////////////
// Asset listing fee