Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.5.2] Fix wrong account age data access #4981

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ public String getDisplayString() {
private final User user;
private final SignedWitnessService signedWitnessService;
private final ChargeBackRisk chargeBackRisk;
private final AccountAgeWitnessStorageService accountAgeWitnessStorageService;
private final FilterManager filterManager;
@Getter
private final AccountAgeWitnessUtils accountAgeWitnessUtils;

@Getter
private final Map<P2PDataStorage.ByteArray, AccountAgeWitness> accountAgeWitnessMap = new HashMap<>();

Expand All @@ -162,6 +162,7 @@ public AccountAgeWitnessService(KeyRing keyRing,
this.user = user;
this.signedWitnessService = signedWitnessService;
this.chargeBackRisk = chargeBackRisk;
this.accountAgeWitnessStorageService = accountAgeWitnessStorageService;
this.filterManager = filterManager;

accountAgeWitnessUtils = new AccountAgeWitnessUtils(
Expand All @@ -185,10 +186,10 @@ public void onAllServicesInitialized() {
});

// At startup the P2PDataStorage initializes earlier, otherwise we get the listener called.
p2PService.getP2PDataStorage().getAppendOnlyDataStoreMap().values().forEach(e -> {
if (e instanceof AccountAgeWitness)
addToMap((AccountAgeWitness) e);
});
accountAgeWitnessStorageService.getMapOfAllData().values().stream()
.filter(e -> e instanceof AccountAgeWitness)
.map(e -> (AccountAgeWitness) e)
.forEach(this::addToMap);

if (p2PService.isBootstrapped()) {
onBootStrapped();
Expand Down