Bitcoin-ABC / bitcoin-abc

Bitcoin ABC develops node software and infrastructure for the eCash project. This a mirror of the official Bitcoin-ABC repository. Please see README.md
https://reviews.bitcoinabc.org
MIT License
1.24k stars 790 forks source link

URI handler incorrectly opens a second instance on Ubuntu #318

Open unusualbob opened 5 years ago

unusualbob commented 5 years ago

Describe the issue

When attempting to open a bitcoincash: url when bitcoin ABC is already open, a new instance is opened and so throws the error:

Cannot obtain a lock on data directory XXXX. Bitcoin ABC is probably already running.

Can you reliably reproduce the issue?

If so, please list the steps to reproduce below:

  1. Fetch and untar bitcoin-abc
  2. Create a bitcoin-abc.desktop with contents:
    [Desktop Entry]
    Version=1.0
    Name=Bitcoin ABC
    Comment=Connect to the Bitcoin P2P Network
    Exec=/path/to/bitcoin-qt -datadir=/your/data/dir %u
    Terminal=false
    Type=Application
    MimeType=x-scheme-handler/bitcoincash;
    Categories=Office;Finance;
  3. run xdg-desktop-menu install bitcoin-abc.desktop
  4. start bitcoin abc
  5. try clicking a link such as bitcoincash:?r=https://test.bitpay.com/i/VtmkwgsJtt69EwSXfkLR7n
  6. error will appear

Expected behaviour

Clicking a bitcoincash link should open in the currently running instance of bitcoin ABC.

Actual behaviour

A new instance of bitcoin ABC is launched, resulting in an error.

What version of bitcoin-abc are you using?

0.19.3 and 0.17.0 tested

Machine specs:

Any extra information that might be useful in the debugging process.

Despite an identical setup, bitcoin core does not exhibit this behavior, meaning there is likely something that can be gleaned from how they handle this.

I also have a built dockerfile that can replicate most of these steps and I can provide that if it would be helpful.

jasonbcox commented 5 years ago

Can you clarify if this was working in 0.17.0 or is also broken on that version?

Thanks for reporting this.

unusualbob commented 5 years ago

It is also broken on that version, just happened to also have that version locally so figured I'd go ahead and check to see if it was a recent issue or something that had been around a while.