use of bisq.network.p2p.P2PService in project bisq-core by bisq-network.
the class ArbitratorManager method onAllServicesInitialized.
// /////////////////////////////////////////////////////////////////////////////////////////
// API
// /////////////////////////////////////////////////////////////////////////////////////////
public void onAllServicesInitialized() {
arbitratorService.addHashSetChangedListener(new HashMapChangedListener() {
@Override
public void onAdded(ProtectedStorageEntry data) {
if (data.getProtectedStoragePayload() instanceof Arbitrator)
updateArbitratorMap();
}
@Override
public void onRemoved(ProtectedStorageEntry data) {
if (data.getProtectedStoragePayload() instanceof Arbitrator) {
updateArbitratorMap();
final Arbitrator arbitrator = (Arbitrator) data.getProtectedStoragePayload();
user.removeAcceptedArbitrator(arbitrator);
user.removeAcceptedMediator(getMediator(arbitrator));
}
}
});
persistedAcceptedArbitrators = new ArrayList<>(user.getAcceptedArbitrators());
user.clearAcceptedArbitrators();
// TODO we mirror arbitrator data for mediator as long we have not impl. it in the UI
user.clearAcceptedMediators();
if (user.getRegisteredArbitrator() != null) {
P2PService p2PService = arbitratorService.getP2PService();
if (p2PService.isBootstrapped())
startRepublishArbitrator();
else
p2PService.addP2PServiceListener(new BootstrapListener() {
@Override
public void onUpdatedDataReceived() {
startRepublishArbitrator();
}
});
}
filterManager.filterProperty().addListener((observable, oldValue, newValue) -> updateArbitratorMap());
updateArbitratorMap();
}
Aggregations