mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-11-25 18:26:28 -05:00
feat: Reliable Peer Discovery (#408)
* feat(swap): Allow discovery at multiple rendezvous points, request quotes from locally stored peers - Ensure uniqueness of the peer_addresses table (no duplicate entries) - Add peer to local database even if we just request a quote, and no swap (call to list_sellers) - Refactor list_sellers to take multiple rendezvous points - Allow db to be passed into list_sellers, if so request quote from all locally stored peers * feat: editable list of rendezvous points in settings, new maker box on help page * Recover old commits * fix small compile errors due to rebase * amend * fixes * fix(gui): Do not display "Core components are loading..." spinner * fix(gui): Prefer makers with m.minSwapAmount > 0 BTC * feat(cli, gui): Fetch version of maker * feat: display progress bar
This commit is contained in:
parent
686947e8dc
commit
4702bd5bf2
31 changed files with 1869 additions and 512 deletions
|
|
@ -20,6 +20,7 @@ import {
|
|||
checkContextAvailability,
|
||||
getSwapInfo,
|
||||
initializeContext,
|
||||
listSellersAtRendezvousPoint,
|
||||
updateAllNodeStatuses,
|
||||
} from "./rpc";
|
||||
import { store } from "./store/storeRenderer";
|
||||
|
|
@ -30,6 +31,9 @@ const TAURI_UNIFIED_EVENT_CHANNEL_NAME = "tauri-unified-event";
|
|||
// Update the public registry every 5 minutes
|
||||
const PROVIDER_UPDATE_INTERVAL = 5 * 60 * 1_000;
|
||||
|
||||
// Discover peers every 5 minutes
|
||||
const DISCOVER_PEERS_INTERVAL = 5 * 60 * 1_000;
|
||||
|
||||
// Update node statuses every 2 minutes
|
||||
const STATUS_UPDATE_INTERVAL = 2 * 60 * 1_000;
|
||||
|
||||
|
|
@ -50,6 +54,11 @@ export async function setupBackgroundTasks(): Promise<void> {
|
|||
setIntervalImmediate(updateAllNodeStatuses, STATUS_UPDATE_INTERVAL);
|
||||
setIntervalImmediate(updateRates, UPDATE_RATE_INTERVAL);
|
||||
setIntervalImmediate(fetchAllConversations, FETCH_CONVERSATIONS_INTERVAL);
|
||||
setIntervalImmediate(
|
||||
() =>
|
||||
listSellersAtRendezvousPoint(store.getState().settings.rendezvousPoints),
|
||||
DISCOVER_PEERS_INTERVAL,
|
||||
);
|
||||
|
||||
// Fetch all alerts
|
||||
updateAlerts();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue