Use PersistenceManager

This commit is contained in:
chimp1984 2020-10-01 20:03:41 -05:00
parent 482bc56036
commit fe4c21b35c
No known key found for this signature in database
GPG Key ID: 9801B4EC591F90E3

View File

@ -35,15 +35,14 @@ import bisq.network.p2p.network.TorNetworkNode;
import bisq.network.p2p.peers.PeerManager;
import bisq.network.p2p.peers.keepalive.KeepAliveManager;
import bisq.network.p2p.peers.peerexchange.PeerExchangeManager;
import bisq.network.p2p.peers.peerexchange.PeerList;
import bisq.network.p2p.storage.messages.BroadcastMessage;
import bisq.common.ClockWatcher;
import bisq.common.config.Config;
import bisq.common.file.CorruptedStorageFileHandler;
import bisq.common.persistence.PersistenceManager;
import bisq.common.proto.network.NetworkEnvelope;
import bisq.common.proto.network.NetworkProtoResolver;
import bisq.common.storage.Storage;
import java.time.Clock;
@ -134,7 +133,7 @@ public class P2PNetworkLoad extends Metric implements MessageListener, SetupList
networkProtoResolver, storageDir, corruptedStorageFileHandler);
DefaultSeedNodeRepository seedNodeRepository = new DefaultSeedNodeRepository(config);
PeerManager peerManager = new PeerManager(networkNode, seedNodeRepository, new ClockWatcher(),
maxConnections, new Storage<PeerList>(storageDir, persistenceProtoResolver, corruptedStorageFileHandler));
maxConnections, new PersistenceManager<>(storageDir, persistenceProtoResolver, corruptedStorageFileHandler));
// init file storage
peerManager.readPersisted();