diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/api.js | 4 | ||||
| -rw-r--r-- | src/wallet.js | 4 |
2 files changed, 6 insertions, 2 deletions
@@ -119,6 +119,9 @@ export const COINOS_ELECTRUM = false; const COINOS_ELECTRUM_URL = 'wss://coinos.io/electrum'; export function getBackend() { + // Regtest runs Fulcrum (Electrum over WS) for both data and realtime push — + // matches prod and drops the esplora/electrs dependency. + if (getNetwork() === 'regtest') return 'electrum'; const m = getDataMode(); if (m === 'electrum') return 'electrum'; if (m === 'coinos' && COINOS_ELECTRUM) return 'electrum'; @@ -156,6 +159,7 @@ export function setElectrumServerConfig({ server, url }) { // addresses to a public server you didn't pick. const PUBLIC_ELECTRUM = () => ELECTRUM_PRESETS.filter((x) => x.url).map((x) => x.url); export function electrumCandidates() { + if (getNetwork() === 'regtest') return [getRegtestElectrumWs()]; // local Fulcrum if (getDataMode() === 'coinos' && COINOS_ELECTRUM) return [COINOS_ELECTRUM_URL, ...PUBLIC_ELECTRUM()]; const cfg = getElectrumServerConfig(); if (cfg.server === 'custom') return cfg.url.trim() ? [cfg.url.trim()] : []; diff --git a/src/wallet.js b/src/wallet.js index a721c00..a3b2429 100644 --- a/src/wallet.js +++ b/src/wallet.js @@ -1269,8 +1269,8 @@ export class Wallet { // and balances update with no polling. wsUrl() { // Electrum backend: pick the current failover candidate (rotated on failure). - // Electrum is mainnet-only here; testnet/regtest use esplora + polling. - if (getBackend() === 'electrum' && this.netName === 'mainnet') { + // Mainnet (when cut over to Fulcrum) and regtest (local Fulcrum) use Electrum. + if (getBackend() === 'electrum' && (this.netName === 'mainnet' || this.netName === 'regtest')) { if (!this._wsCandidates || !this._wsCandidates.length) { this._wsCandidates = electrumCandidates(); this._wsCandIdx = 0; } const list = this._wsCandidates; return list.length ? list[(this._wsCandIdx || 0) % list.length] : null; |
