Skip to content

Commit

Permalink
fix connection to custom node on startup haveno-dex#945
Browse files Browse the repository at this point in the history
  • Loading branch information
woodser committed May 21, 2024
1 parent 6df5296 commit 3e04a2d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/src/main/java/haveno/core/api/XmrConnectionService.java
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,10 @@ public void onConnectionChanged(MoneroRpcConnection connection) {
}

// restore last connection
if (connectionList.getCurrentConnectionUri().isPresent() && connectionManager.hasConnection(connectionList.getCurrentConnectionUri().get())) {
if (isFixedConnection()) {
if (getConnections().size() != 1) throw new IllegalStateException("Expected connection list to have 1 fixed connection but was: " + getConnections().size());
connectionManager.setConnection(getConnections().get(0));
} else if (connectionList.getCurrentConnectionUri().isPresent() && connectionManager.hasConnection(connectionList.getCurrentConnectionUri().get())) {
if (!HavenoUtils.isLocalHost(connectionList.getCurrentConnectionUri().get()) || !xmrLocalNode.shouldBeIgnored()) {
connectionManager.setConnection(connectionList.getCurrentConnectionUri().get());
}
Expand Down

0 comments on commit 3e04a2d

Please sign in to comment.