fix: setup pool and relays BEFORE bunker reconnection subscription

- Move NostrConnectSigner.pool assignment before active account subscription
- Move pool.group(RELAYS) before subscription
- This ensures pool is ready when bunker signer tries to send requests
- The subscription can fire immediately, so pool must be configured first
- Add log to confirm pool assignment
This commit is contained in:
Gigi
2025-10-16 22:17:48 +02:00
parent f7ff309b6e
commit 19ca909ef5

View File

@@ -221,6 +221,15 @@ function App() {
const pool = new RelayPool()
// Setup NostrConnectSigner to use the relay pool FIRST before any reconnections
NostrConnectSigner.pool = pool
console.log('[bunker] ✅ Pool assigned to NostrConnectSigner')
// Create a relay group for better event deduplication and management
pool.group(RELAYS)
console.log('Created relay group with', RELAYS.length, 'relays (including local)')
console.log('Relay URLs:', RELAYS)
// Reconnect bunker signers when active account changes
// Keep track of which accounts we've already reconnected to avoid double-connecting
const reconnectedAccounts = new Set<string>()
@@ -278,14 +287,6 @@ function App() {
}
})
// Setup NostrConnectSigner to use the relay pool
NostrConnectSigner.pool = pool
// Create a relay group for better event deduplication and management
pool.group(RELAYS)
console.log('Created relay group with', RELAYS.length, 'relays (including local)')
console.log('Relay URLs:', RELAYS)
// Keep all relay connections alive indefinitely by creating a persistent subscription
// This prevents disconnection when no other subscriptions are active
// Create a minimal subscription that never completes to keep connections alive