mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-23 23:06:39 +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
1 changed files with 13 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue