bitcoin-abc icon indicating copy to clipboard operation
bitcoin-abc copied to clipboard

URI handler incorrectly opens a second instance on Ubuntu

Open unusualbob opened this issue 6 years ago • 2 comments
trafficstars

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;
  1. run xdg-desktop-menu install bitcoin-abc.desktop
  2. start bitcoin abc
  3. try clicking a link such as bitcoincash:?r=https://test.bitpay.com/i/VtmkwgsJtt69EwSXfkLR7n
  4. 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:

  • OS: Ubuntu 18.04 / Ubuntu 16.04
  • CPU: Intel i7
  • RAM: 32G
  • Disk size: 1 TB
  • Disk Type (HD/SDD): SSD

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.

unusualbob avatar Apr 19 '19 06:04 unusualbob

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

Thanks for reporting this.

jasonbcox avatar Apr 22 '19 16:04 jasonbcox

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.

unusualbob avatar Apr 22 '19 16:04 unusualbob