The demo app allows users to choose a different Electrum server for Signet or Testnet. That selection is respected when syncing the wallet and fetching fee estimates, but it is not used when broadcasting a transaction.
The send flow creates its blockchain client using only the wallet network. BlockchainService.createClient() then reads from defaultEndpoints, so a transaction is always broadcast through the default server even when the user selected another one.
Steps to reproduce
- Load a Signet or Testnet wallet in the demo app.
- Open Change server and select a non-default server.
- Sync the wallet and open the Send screen.
- Build, confirm, and broadcast a transaction.
- Observe that the broadcast client is created from the network's default endpoint rather than the selected endpoint.
Expected behavior
Sync, fee estimation, and transaction broadcast should all use the endpoint selected for the active wallet's network.
Actual behavior
Sync and fee estimation use endpointConfigProvider, while broadcast calls blockchainClientFactoryProvider with record.network. The default factory delegates to BlockchainService.createClient(), which uses defaultEndpoints[network].
Why this matters
If someone changes servers because the default server is unavailable, wallet sync and fee estimates may work through the selected server while broadcasting still fails against the unavailable default. It also means the app does not honor the user's server and privacy choice for the most sensitive network action.
Relevant code
bdk_demo/lib/providers/network_endpoint_providers.dart resolves and stores the selected endpoint.
bdk_demo/lib/providers/blockchain_providers.dart passes the selected endpoint to wallet sync.
bdk_demo/lib/providers/send_providers.dart owns the broadcast client factory and fee-estimate endpoint selection.
bdk_demo/lib/features/send/send_page.dart requests a broadcast client for the active wallet network.
bdk_demo/lib/services/blockchain_service.dart creates clients from endpoint configuration.
Agreed implementation
Keep BlockchainClientFactory accepting WalletNetwork, resolve endpointConfigProvider(network) inside blockchainClientFactoryProvider, and create the client from that resolved endpoint. Add focused offline coverage for the UI-to-provider network boundary and the provider-to-service endpoint boundary.
Remove the unused backendForNetwork helper in a separate documented commit because it only reflects default endpoints and has no remaining callers.
This should remain separate from the transaction-history work in #102.
The demo app allows users to choose a different Electrum server for Signet or Testnet. That selection is respected when syncing the wallet and fetching fee estimates, but it is not used when broadcasting a transaction.
The send flow creates its blockchain client using only the wallet network.
BlockchainService.createClient()then reads fromdefaultEndpoints, so a transaction is always broadcast through the default server even when the user selected another one.Steps to reproduce
Expected behavior
Sync, fee estimation, and transaction broadcast should all use the endpoint selected for the active wallet's network.
Actual behavior
Sync and fee estimation use
endpointConfigProvider, while broadcast callsblockchainClientFactoryProviderwithrecord.network. The default factory delegates toBlockchainService.createClient(), which usesdefaultEndpoints[network].Why this matters
If someone changes servers because the default server is unavailable, wallet sync and fee estimates may work through the selected server while broadcasting still fails against the unavailable default. It also means the app does not honor the user's server and privacy choice for the most sensitive network action.
Relevant code
bdk_demo/lib/providers/network_endpoint_providers.dartresolves and stores the selected endpoint.bdk_demo/lib/providers/blockchain_providers.dartpasses the selected endpoint to wallet sync.bdk_demo/lib/providers/send_providers.dartowns the broadcast client factory and fee-estimate endpoint selection.bdk_demo/lib/features/send/send_page.dartrequests a broadcast client for the active wallet network.bdk_demo/lib/services/blockchain_service.dartcreates clients from endpoint configuration.Agreed implementation
Keep
BlockchainClientFactoryacceptingWalletNetwork, resolveendpointConfigProvider(network)insideblockchainClientFactoryProvider, and create the client from that resolved endpoint. Add focused offline coverage for the UI-to-provider network boundary and the provider-to-service endpoint boundary.Remove the unused
backendForNetworkhelper in a separate documented commit because it only reflects default endpoints and has no remaining callers.This should remain separate from the transaction-history work in #102.