Skip to content

feat[electrum]: Support server.features on all feature combinations - #150

Merged
mononaut merged 2 commits into
mempoolfrom
junderw/feat/electrum-features
Jun 3, 2026
Merged

mononaut merged 2 commits into
mempoolfrom
junderw/feat/electrum-features

Conversation

@junderw

@junderw junderw commented May 24, 2026

Copy link
Copy Markdown
Member

Closes #149

Adds the server.features endpoint on electrum regardless of feature flags.

If the electrum-discovery feature isn't enabled, the hosts value is an empty HashMap.

At least this will prevent errors when clients attempt to query this.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds unconditional support for the Electrum server.features RPC so Electrum/Sparrow clients don’t fail when electrum-discovery is not enabled, aligning behavior with the standard Electrum protocol expectations.

Changes:

  • Make server.features available regardless of electrum-discovery, returning a shared ServerFeatures struct per connection.
  • Always include electrum_public_hosts in Config, defaulting to None when electrum-discovery is disabled so hosts serializes as an empty map.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/electrum/server.rs Removes feature-gating for server.features and wires a shared Arc<ServerFeatures> into each connection.
src/config.rs Makes electrum_public_hosts part of Config in all builds, with None when discovery is not compiled in.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mononaut mononaut left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested ACK @ [15e9430]

tested with the various combinations of electrum-discovery and --electrum-public-hosts and confirmed this fixes the server.features RPC error and doesn't seem to break anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

server.features should always be supported

4 participants