add HavenoUtils.isSeedNode()

This commit is contained in:
woodser 2024-01-14 09:44:07 -05:00
parent 1a981f28df
commit df27902577
4 changed files with 21 additions and 17 deletions

View File

@ -519,7 +519,7 @@ public final class XmrConnectionService {
private void maybeStartLocalNode() { private void maybeStartLocalNode() {
// skip if seed node // skip if seed node
if (HavenoUtils.havenoSetup == null) return; if (HavenoUtils.isSeedNode()) return;
// start local node if offline and used as last connection // start local node if offline and used as last connection
if (connectionManager.getConnection() != null && xmrLocalNode.equalsUri(connectionManager.getConnection().getUri()) && !xmrLocalNode.isDetected() && !xmrLocalNode.shouldBeIgnored()) { if (connectionManager.getConnection() != null && xmrLocalNode.equalsUri(connectionManager.getConnection().getUri()) && !xmrLocalNode.isDetected() && !xmrLocalNode.shouldBeIgnored()) {

View File

@ -74,6 +74,10 @@ public class HavenoUtils {
public static ArbitrationManager arbitrationManager; public static ArbitrationManager arbitrationManager;
public static HavenoSetup havenoSetup; public static HavenoSetup havenoSetup;
public static boolean isSeedNode() {
return havenoSetup == null;
}
// ----------------------- CONVERSION UTILS ------------------------------- // ----------------------- CONVERSION UTILS -------------------------------
public static BigInteger coinToAtomicUnits(Coin coin) { public static BigInteger coinToAtomicUnits(Coin coin) {

View File

@ -428,7 +428,7 @@ public class TradeManager implements PersistedDataHost, DecryptedDirectMessageLi
} }
// process after all wallets initialized // process after all wallets initialized
if (HavenoUtils.havenoSetup != null) { // null for seednode if (!HavenoUtils.isSeedNode()) {
// maybe remove trades on error // maybe remove trades on error
for (Trade trade : tradesToMaybeRemoveOnError) { for (Trade trade : tradesToMaybeRemoveOnError) {