mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 07:07:43 +01:00
Refactor: Move code for adding decryptedBallotsWithMeritsSet to daoStateService
This commit is contained in:
parent
5702ab03cc
commit
076e3faf95
2 changed files with 8 additions and 3 deletions
|
@ -176,9 +176,7 @@ public class VoteResultService implements DaoStateListener, DaoSetupService {
|
||||||
long startTs = System.currentTimeMillis();
|
long startTs = System.currentTimeMillis();
|
||||||
|
|
||||||
Set<DecryptedBallotsWithMerits> decryptedBallotsWithMeritsSet = getDecryptedBallotsWithMeritsSet(chainHeight);
|
Set<DecryptedBallotsWithMerits> decryptedBallotsWithMeritsSet = getDecryptedBallotsWithMeritsSet(chainHeight);
|
||||||
decryptedBallotsWithMeritsSet.stream()
|
daoStateService.addAllDecryptedBallotsWithMeritsList(decryptedBallotsWithMeritsSet);
|
||||||
.filter(e -> !daoStateService.getDecryptedBallotsWithMeritsList().contains(e))
|
|
||||||
.forEach(daoStateService.getDecryptedBallotsWithMeritsList()::add);
|
|
||||||
|
|
||||||
if (!decryptedBallotsWithMeritsSet.isEmpty()) {
|
if (!decryptedBallotsWithMeritsSet.isEmpty()) {
|
||||||
// From the decryptedBallotsWithMerits we create a map with the hash of the blind vote list as key and the
|
// From the decryptedBallotsWithMerits we create a map with the hash of the blind vote list as key and the
|
||||||
|
|
|
@ -912,6 +912,13 @@ public class DaoStateService implements DaoSetupService {
|
||||||
return daoState.getDecryptedBallotsWithMeritsList();
|
return daoState.getDecryptedBallotsWithMeritsList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void addAllDecryptedBallotsWithMeritsList(Set<DecryptedBallotsWithMerits> decryptedBallotsWithMeritsSet) {
|
||||||
|
decryptedBallotsWithMeritsSet.stream()
|
||||||
|
.filter(e -> !daoState.getDecryptedBallotsWithMeritsList().contains(e))
|
||||||
|
.forEach(daoState.getDecryptedBallotsWithMeritsList()::add);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Asset listing fee
|
// Asset listing fee
|
||||||
|
|
Loading…
Add table
Reference in a new issue