Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bisq does not update onion address of offers after deleting Tor data #3995

Closed
wiz opened this issue Feb 21, 2020 · 3 comments · Fixed by #4018 or #4021
Closed

Bisq does not update onion address of offers after deleting Tor data #3995

wiz opened this issue Feb 21, 2020 · 3 comments · Fixed by #4018 or #4021
Labels
a:bug is:critical https://bisq.wiki/Critical_bug re:Tor

Comments

@wiz
Copy link
Contributor

wiz commented Feb 21, 2020

Description

If a user with open offers presses the "Delete outdated Tor files and restart" button, their offers are not updated to the node's new onion address, so they cannot be taken by anyone

Version

v1.2.7

Steps to reproduce

  1. Create an offer
  2. Note the onion address of your offer
  3. Settings -> Network Info -> Open Tor Settings -> "Delete outdated Tor files and restart"
  4. After restarting, note the onion address of your offer again
  5. Create a 2nd offer
  6. Note the onion address of your 2nd offer
  7. Attempt to take your 1st offer from another node
  8. Attempt to take your 2nd offer from another node

Expected behaviour

  1. The onion address returned in step 4 should be updated to your node's new onion address after resetting Tor, so it should not be the same as the onion address returned in step 2
  2. The onion addresses of all your offers should be the same
  3. All of your offers should be taken by the other node

Actual behaviour

  1. The onion addresses returned in steps 2 and 4 are the same
  2. The onion addresses of 1st offer and 2nd offer are different
  3. The 1st offer can not be taken
@ripcurlx ripcurlx added a:bug is:critical https://bisq.wiki/Critical_bug re:Tor labels Feb 21, 2020
@freimair
Copy link
Contributor

onto it

@freimair
Copy link
Contributor

freimair commented Feb 28, 2020

Looked into it and these are the results:

I am having a hard time reproducing the issue.

Settings -> Network Info -> Open Tor Settings -> "Delete outdated Tor files and restart" does not delete the hidden service files. it only cleans up around them.

see for reference

public void cleanupTorFiles(@Nullable Runnable resultHandler, @Nullable ErrorMessageHandler errorMessageHandler) {
File hiddenservice = new File(Paths.get(torDir.getAbsolutePath(), "hiddenservice").toString());
try {
FileUtil.deleteDirectory(torDir, hiddenservice, true);

This piece of code btw gets called on every application start:

  • if there is an issue it would show every time an application gets started with offer already opened
  • renders the "Delete outdated Tor files and restart" button kind of useless

If you manually delete the files

However, I agree that when you manually delete the .../hiddenservice directory, then everything you say is true.

Questions

  • There seems to be now way of getting into the situation you described by doing the steps you provided. Is there anything special about your setup?

  • Furthermore, shall we fix the behavior if someone tempers with the tor directory manually? is this a common practice to suggest this in support?

Testing environment

I tried to reproduce the thing using

  • master build
  • tag v1.2.7

@freimair
Copy link
Contributor

It seems the actual cause of this issue is some bug in the tor dir cleanup procedure.

Looks like relative paths and special characters in --appDataDir cause the cleanup logic to not spare the hiddenservice directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:bug is:critical https://bisq.wiki/Critical_bug re:Tor
Projects
None yet
3 participants