liana
liana copied to clipboard
Handling several Liana instance w/ managed bitcoind
We can currently start several instance of Liana in a managed bitcoind context:
- First instance will start bitcoind (if not already running), and will 'remember' that it should close bitcoind when closed itself.
- Any other instance start after this one will not start bitcoind, neither close it on it self stop.
If you do so, then close the first instance, any other instance will be stuck/freeze/crash because lost connexion w/ bitcoind.
I think there is several way to handle this:
- Detect if a Liana instance already running w/ the managed bitcoind, if so, don't allow to start a second one if it is willing to also manage the bitcoind ( I don't really like this one)
- Notice other instances we using this bitcoind (by creating a <instance_pid>.pid in bitcoind datadir folder?) and have a 'smart' management ( only the first running instance can start bitcoind, only the last stopping can close bitcoind)