From 92fb41fffaf130e540f1acee3b443a1e4d3c0b43 Mon Sep 17 00:00:00 2001 From: woodser Date: Wed, 31 May 2023 17:14:42 -0400 Subject: [PATCH] add second seed node --- Makefile | 9 +++++ .../java/haveno/core/trade/TradeManager.java | 33 ++++++++++--------- core/src/main/resources/xmr_local.seednodes | 2 +- .../src/main/resources/xmr_stagenet.seednodes | 2 +- 4 files changed, 28 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index b891bce3..09a3ea81 100644 --- a/Makefile +++ b/Makefile @@ -122,6 +122,15 @@ seednode-local: --appName=haveno-XMR_LOCAL_Seed_2002 \ --xmrNode=http://localhost:28081 \ +seednode2-local: + ./haveno-seednode$(APP_EXT) \ + --baseCurrencyNetwork=XMR_LOCAL \ + --useLocalhostForP2P=true \ + --useDevPrivilegeKeys=true \ + --nodePort=2003 \ + --appName=haveno-XMR_LOCAL_Seed_2003 \ + --xmrNode=http://localhost:28081 \ + arbitrator-daemon-local: # Arbitrator needs to be registered before making trades ./haveno-daemon$(APP_EXT) \ diff --git a/core/src/main/java/haveno/core/trade/TradeManager.java b/core/src/main/java/haveno/core/trade/TradeManager.java index 2c029c17..25f03f2f 100644 --- a/core/src/main/java/haveno/core/trade/TradeManager.java +++ b/core/src/main/java/haveno/core/trade/TradeManager.java @@ -449,22 +449,23 @@ public class TradeManager implements PersistedDataHost, DecryptedDirectMessageLi xmrWalletService.setTradeManager(this); // process after all wallets initialized - if (HavenoUtils.havenoSetup == null) throw new IllegalStateException("HavenoSetup is null; is this an improperly registered seed node?"); - MonadicBinding walletsInitialized = EasyBind.combine(HavenoUtils.havenoSetup.getWalletInitialized(), persistedTradesInitialized, (a, b) -> a && b); - walletsInitialized.subscribe((observable, oldValue, newValue) -> { - if (!newValue) return; - - // thaw unreserved outputs - thawUnreservedOutputs(); - - // reset any available funded address entries - xmrWalletService.getAddressEntriesForAvailableBalanceStream() - .filter(addressEntry -> addressEntry.getOfferId() != null) - .forEach(addressEntry -> { - log.warn("Swapping pending {} entries at startup. offerId={}", addressEntry.getContext(), addressEntry.getOfferId()); - xmrWalletService.swapTradeEntryToAvailableEntry(addressEntry.getOfferId(), addressEntry.getContext()); - }); - }); + if (HavenoUtils.havenoSetup != null) { // null for seednode + MonadicBinding walletsInitialized = EasyBind.combine(HavenoUtils.havenoSetup.getWalletInitialized(), persistedTradesInitialized, (a, b) -> a && b); + walletsInitialized.subscribe((observable, oldValue, newValue) -> { + if (!newValue) return; + + // thaw unreserved outputs + thawUnreservedOutputs(); + + // reset any available funded address entries + xmrWalletService.getAddressEntriesForAvailableBalanceStream() + .filter(addressEntry -> addressEntry.getOfferId() != null) + .forEach(addressEntry -> { + log.warn("Swapping pending {} entries at startup. offerId={}", addressEntry.getContext(), addressEntry.getOfferId()); + xmrWalletService.swapTradeEntryToAvailableEntry(addressEntry.getOfferId(), addressEntry.getContext()); + }); + }); + } // notify that persisted trades initialized persistedTradesInitialized.set(true); diff --git a/core/src/main/resources/xmr_local.seednodes b/core/src/main/resources/xmr_local.seednodes index 44cd4ec2..0c719b4f 100644 --- a/core/src/main/resources/xmr_local.seednodes +++ b/core/src/main/resources/xmr_local.seednodes @@ -1,3 +1,3 @@ # nodeaddress.onion:port [(@owner,@backup)] localhost:2002 (@devtest1) -localhost:3002 (@devtest2) +localhost:2003 (@devtest2) diff --git a/core/src/main/resources/xmr_stagenet.seednodes b/core/src/main/resources/xmr_stagenet.seednodes index 3968dc4b..14a139da 100644 --- a/core/src/main/resources/xmr_stagenet.seednodes +++ b/core/src/main/resources/xmr_stagenet.seednodes @@ -1,3 +1,3 @@ # nodeaddress.onion:port [(@owner)] dl57jitswby4yhzpqpu7pwq6iyqg2x6vkio73araparbftlqoqxhvqad.onion:2002 (@devtest1) - +3cqlkowdu766sto5wrdqpntpsi7kezwkkakc532i6jeiyu7hha726ead.onion:3003 (@devtest1)