mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 18:03:12 +01:00
Refactor: Rename RequestManager to BlocksRequestManager
This commit is contained in:
parent
eca72f658f
commit
d320346a03
@ -23,8 +23,8 @@ import io.bisq.common.app.AppModule;
|
||||
import io.bisq.core.dao.blockchain.BsqBlockChain;
|
||||
import io.bisq.core.dao.blockchain.BsqBlockChainChangeDispatcher;
|
||||
import io.bisq.core.dao.blockchain.json.JsonBlockChainExporter;
|
||||
import io.bisq.core.dao.node.BlocksRequestManager;
|
||||
import io.bisq.core.dao.node.BsqNodeProvider;
|
||||
import io.bisq.core.dao.node.RequestManager;
|
||||
import io.bisq.core.dao.node.consensus.*;
|
||||
import io.bisq.core.dao.node.full.FullNode;
|
||||
import io.bisq.core.dao.node.full.FullNodeExecutor;
|
||||
@ -51,7 +51,7 @@ public class DaoModule extends AppModule {
|
||||
protected void configure() {
|
||||
bind(DaoManager.class).in(Singleton.class);
|
||||
|
||||
bind(RequestManager.class).in(Singleton.class);
|
||||
bind(BlocksRequestManager.class).in(Singleton.class);
|
||||
bind(RpcService.class).in(Singleton.class);
|
||||
bind(FullNodeExecutor.class).in(Singleton.class);
|
||||
bind(LiteNodeExecutor.class).in(Singleton.class);
|
||||
|
@ -24,7 +24,7 @@ import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
public class RequestManager implements MessageListener, ConnectionListener, PeerManager.Listener {
|
||||
public class BlocksRequestManager implements MessageListener, ConnectionListener, PeerManager.Listener {
|
||||
|
||||
private static final long RETRY_DELAY_SEC = 10;
|
||||
private static final long CLEANUP_TIMER = 120;
|
||||
@ -73,11 +73,11 @@ public class RequestManager implements MessageListener, ConnectionListener, Peer
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Inject
|
||||
public RequestManager(NetworkNode networkNode,
|
||||
PeerManager peerManager,
|
||||
Broadcaster broadcaster,
|
||||
SeedNodesRepository seedNodesRepository,
|
||||
BsqBlockChain bsqBlockChain) {
|
||||
public BlocksRequestManager(NetworkNode networkNode,
|
||||
PeerManager peerManager,
|
||||
Broadcaster broadcaster,
|
||||
SeedNodesRepository seedNodesRepository,
|
||||
BsqBlockChain bsqBlockChain) {
|
||||
this.networkNode = networkNode;
|
||||
this.peerManager = peerManager;
|
||||
this.broadcaster = broadcaster;
|
@ -48,7 +48,7 @@ public abstract class BsqNode {
|
||||
protected final String genesisTxId;
|
||||
protected final int genesisBlockHeight;
|
||||
@SuppressWarnings("WeakerAccess")
|
||||
protected final RequestManager requestManager;
|
||||
protected final BlocksRequestManager requestManager;
|
||||
@Getter
|
||||
protected boolean parseBlockchainComplete;
|
||||
@SuppressWarnings("WeakerAccess")
|
||||
@ -63,7 +63,7 @@ public abstract class BsqNode {
|
||||
public BsqNode(P2PService p2PService,
|
||||
BsqBlockChain bsqBlockChain,
|
||||
FeeService feeService,
|
||||
RequestManager requestManager) {
|
||||
BlocksRequestManager requestManager) {
|
||||
|
||||
this.p2PService = p2PService;
|
||||
this.bsqBlockChain = bsqBlockChain;
|
||||
|
@ -25,8 +25,8 @@ import io.bisq.core.dao.blockchain.BsqBlockChainListener;
|
||||
import io.bisq.core.dao.blockchain.exceptions.BlockNotConnectingException;
|
||||
import io.bisq.core.dao.blockchain.json.JsonBlockChainExporter;
|
||||
import io.bisq.core.dao.blockchain.vo.BsqBlock;
|
||||
import io.bisq.core.dao.node.BlocksRequestManager;
|
||||
import io.bisq.core.dao.node.BsqNode;
|
||||
import io.bisq.core.dao.node.RequestManager;
|
||||
import io.bisq.core.provider.fee.FeeService;
|
||||
import io.bisq.network.p2p.P2PService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -53,7 +53,7 @@ public class FullNode extends BsqNode {
|
||||
BsqBlockChain bsqBlockChain,
|
||||
JsonBlockChainExporter jsonBlockChainExporter,
|
||||
FeeService feeService,
|
||||
RequestManager requestManager) {
|
||||
BlocksRequestManager requestManager) {
|
||||
super(p2PService,
|
||||
bsqBlockChain,
|
||||
feeService,
|
||||
|
@ -24,8 +24,8 @@ import io.bisq.core.dao.blockchain.BsqBlockChain;
|
||||
import io.bisq.core.dao.blockchain.BsqBlockChainListener;
|
||||
import io.bisq.core.dao.blockchain.exceptions.BlockNotConnectingException;
|
||||
import io.bisq.core.dao.blockchain.vo.BsqBlock;
|
||||
import io.bisq.core.dao.node.BlocksRequestManager;
|
||||
import io.bisq.core.dao.node.BsqNode;
|
||||
import io.bisq.core.dao.node.RequestManager;
|
||||
import io.bisq.core.dao.node.messages.GetBsqBlocksResponse;
|
||||
import io.bisq.core.dao.node.messages.NewBsqBlockBroadcastMessage;
|
||||
import io.bisq.core.provider.fee.FeeService;
|
||||
@ -57,7 +57,7 @@ public class LiteNode extends BsqNode {
|
||||
LiteNodeExecutor bsqLiteNodeExecutor,
|
||||
BsqBlockChain bsqBlockChain,
|
||||
FeeService feeService,
|
||||
RequestManager requestManager) {
|
||||
BlocksRequestManager requestManager) {
|
||||
super(p2PService,
|
||||
bsqBlockChain,
|
||||
feeService,
|
||||
@ -84,7 +84,7 @@ public class LiteNode extends BsqNode {
|
||||
protected void onP2PNetworkReady() {
|
||||
super.onP2PNetworkReady();
|
||||
|
||||
requestManager.addListener(new RequestManager.Listener() {
|
||||
requestManager.addListener(new BlocksRequestManager.Listener() {
|
||||
@Override
|
||||
public void onRequestedBlocksReceived(GetBsqBlocksResponse getBsqBlocksResponse) {
|
||||
LiteNode.this.onRequestedBlocksReceived(new ArrayList<>(getBsqBlocksResponse.getBsqBlocks()));
|
||||
|
Loading…
Reference in New Issue
Block a user