mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 01:41:11 +01:00
Merge pull request #5041 from chimp1984/request-only-not-seeds-if-no-seed-available
Request only non-seed nodes if no seed nodes are available
This commit is contained in:
commit
4da1bb0c10
@ -375,7 +375,7 @@ public class RequestDataManager implements MessageListener, ConnectionListener,
|
||||
listener.onNoPeersAvailable();
|
||||
}
|
||||
|
||||
restart();
|
||||
requestFromNonSeedNodePeers();
|
||||
} else {
|
||||
log.info("We could not connect to seed node {} but we have other connection attempts open.", nodeAddress.getFullAddress());
|
||||
}
|
||||
@ -405,6 +405,18 @@ public class RequestDataManager implements MessageListener, ConnectionListener,
|
||||
// Utils
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private void requestFromNonSeedNodePeers() {
|
||||
List<NodeAddress> list = getFilteredNonSeedNodeList(getSortedNodeAddresses(peerManager.getReportedPeers()), new ArrayList<>());
|
||||
List<NodeAddress> filteredPersistedPeers = getFilteredNonSeedNodeList(getSortedNodeAddresses(peerManager.getPersistedPeers()), list);
|
||||
list.addAll(filteredPersistedPeers);
|
||||
|
||||
if (!list.isEmpty()) {
|
||||
NodeAddress nextCandidate = list.get(0);
|
||||
list.remove(nextCandidate);
|
||||
requestData(nextCandidate, list);
|
||||
}
|
||||
}
|
||||
|
||||
private void restart() {
|
||||
if (retryTimer == null) {
|
||||
retryTimer = UserThread.runAfter(() -> {
|
||||
|
Loading…
Reference in New Issue
Block a user