mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-09 23:22:16 -04:00
add second seed node
This commit is contained in:
parent
a70fd2b18c
commit
92fb41fffa
4 changed files with 28 additions and 18 deletions
|
@ -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<Boolean> 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<Boolean> 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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue