Skip to content

Commit

Permalink
Merge branch 'develop' into release/1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SailReal committed Sep 29, 2021
2 parents cfc3f86 + 3ce4dce commit b119630
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,20 @@ public ConnectedWallet(DBusConnection connection) {

static Optional<ConnectedWallet> connect() {
try {
return Optional.of(new ConnectedWallet(getConnection()));
return Optional.of(new ConnectedWallet(getNewConnection()));
} catch (DBusException e) {
LOG.warn("Connecting to D-Bus failed.", e);
return Optional.empty();
}
}

private static DBusConnection getConnection() throws DBusException {
private static DBusConnection getNewConnection() throws DBusException {
try {
return DBusConnection.getConnection(DBusConnection.DBusBusType.SESSION);
return DBusConnection.newConnection(DBusConnection.DBusBusType.SESSION);
} catch (DBusConnectionException ce) {
LOG.warn("SESSION DBus not found, falling back to SYSTEM DBus");
try {
return DBusConnection.getConnection(DBusConnection.DBusBusType.SYSTEM);
return DBusConnection.newConnection(DBusConnection.DBusBusType.SYSTEM);
} catch (DBusException e) {
throw e;
}
Expand Down

0 comments on commit b119630

Please sign in to comment.