mazaclub / encompass

BIP-0044 compliant multi-currency wallet based on Electrum. Extendable with ChainKey modules to most coins!
GNU General Public License v3.0
39 stars 22 forks source link

setchain with daemon does not switch electrum-server #139

Open ELM4Ever opened 9 years ago

ELM4Ever commented 9 years ago

When changing chain with only the daemon running, encompass does not switch to the new chain electrum-servers. (today's version of develop branch).

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/24346284-setchain-with-daemon-does-not-switch-electrum-server?utm_campaign=plugin&utm_content=tracker%2F11867956&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F11867956&utm_medium=issues&utm_source=github).
Kefkius commented 9 years ago

Yeah, setchain only changes the active chain in the user config. The thing about the daemon is that as it currently stands, the daemon can't switch chains like the rest of the wallet. There isn't a mechanism in place to make the daemon switch to the new set of servers.

That's why none of the commands that require a network connection have the --chain optional argument available. The Network class that controls the core behavior of this has no means of switching chains. It's something we're aware of, we just haven't agreed on the best solution.

Our known options are:

  1. Create functionality for the Network class to switch chains like the rest of Encompass.
  2. Use one Network thread per chain.

The first option is the most intuitive, but the second option paves the way for a server managing multiple currencies at once. However, the second option comes with more complications as well. It would mean a lot more threads running concurrently (each server connected to also has its own thread).

Until we figure out the best solution, this issue will exist. At least this creates a place for discussion on the decision-making.

ELM4Ever commented 9 years ago

My interests would lean towards option 2.

A work around would be to run two instances of option 1 in parallel - but it wouldn't be as elegant as option 2.

Kefkius commented 9 years ago

@ELM4Ever For expediency I already implemented option 1. However, a way to run the daemon that supports having more than one coin network at a time is something I've been thinking about. It will likely be implemented in the future.

Keep this issue open in the meantime.