diff --git a/core/src/main/java/bisq/core/account/witness/AccountAgeWitnessService.java b/core/src/main/java/bisq/core/account/witness/AccountAgeWitnessService.java index e947cba1287..45385904c30 100644 --- a/core/src/main/java/bisq/core/account/witness/AccountAgeWitnessService.java +++ b/core/src/main/java/bisq/core/account/witness/AccountAgeWitnessService.java @@ -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 accountAgeWitnessMap = new HashMap<>(); @@ -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( @@ -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();