mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Log error (and throw exception if in devMode) if
HistoricalDataStoreService.getMap is called. HistoricalDataStoreService.getMap should not be used by domain clients but rather the custom methods getMapOfAllData, getMapOfLiveData or getMapSinceVersion. As we have not removed the calls from ProposalService and other domains we return getMapOfAllData() instead of the live map. This was prevented earlier for performance reasons. It is more safe thought to return in case of an illegal access all data instead of live data only.
This commit is contained in:
parent
4489e57849
commit
6a35410c69
@ -20,6 +20,7 @@ package bisq.network.p2p.storage.persistence;
|
||||
import bisq.network.p2p.storage.P2PDataStorage;
|
||||
import bisq.network.p2p.storage.payload.PersistableNetworkPayload;
|
||||
|
||||
import bisq.common.app.DevEnv;
|
||||
import bisq.common.app.Version;
|
||||
import bisq.common.persistence.PersistenceManager;
|
||||
|
||||
@ -109,15 +110,11 @@ public abstract class HistoricalDataStoreService<T extends PersistableNetworkPay
|
||||
// MapStoreService
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// TODO optimize so that callers to AppendOnlyDataStoreService are not invoking that often getMap
|
||||
// ProposalService is one of the main callers and could avoid it by using the ProposalStoreService directly
|
||||
// instead of AppendOnlyDataStoreService
|
||||
|
||||
// By default we return the live data only. This method should not be used by domain clients but rather the
|
||||
// custom methods getMapOfAllData, getMapOfLiveData or getMapSinceVersion
|
||||
@Override
|
||||
public Map<P2PDataStorage.ByteArray, PersistableNetworkPayload> getMap() {
|
||||
return store.getMap();
|
||||
DevEnv.logErrorAndThrowIfDevMode("HistoricalDataStoreService.getMap should not be used by domain " +
|
||||
"clients but rather the custom methods getMapOfAllData, getMapOfLiveData or getMapSinceVersion");
|
||||
return getMapOfAllData();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user