Skip to content

Conversation

@dcousens
Copy link
Contributor

Resolves [the noise aspect of] #7032

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes this would be equivalent:

LogPrint("tor", "tor: Disconnected from Tor control port %s, trying to reconnect\n", target);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @MarcoFalke, Ill change it

@dcousens
Copy link
Contributor Author

I'm also not sure if you'd always want to silence all these messages, especially if a tor connection did exist at one point.

@gmaxwell
Copy link
Contributor

utACK, we should at least be silencing these if it was never up. Otherwise it's noise for people who don't have it configured. This was why I was asking the other day if the authstring is ever empty: perhaps we could not bother trying if its empty?

@maflcko
Copy link
Member

maflcko commented Nov 17, 2015

The problem is, that this can be caused by various things:

  • Tor not running
  • Wrong tor password provided
  • ...?

Event though, you can use an empty string as password, bitcoin will consider it as no password ( https://github.com/bitcoin/bitcoin/pull/6639/files#diff-eceb168df4d9787d4474a99c72db339aR585 )

So maybe a safe solution is to not print further tor debug stuff if the password is empty? (Same holds for non existent auth cookie?)

@laanwj
Copy link
Member

laanwj commented Nov 17, 2015

So maybe a safe solution is to not print further tor debug stuff if the password is empty? (Same holds for non existent auth cookie?)

That doesn't work. It only knows where the auth cookie is after connecting to Tor. Also the user may start Tor later, resulting in a different auth cookie (or even auth cookie location). It simply cannot know without trying.

I think this solution is fine.

Would be somewhat better to detect if there was a connection in the first place, and to always log a message if there was, and log a different message only w/ debug=tor if there wasn't (as this is only useful for troubleshooting).

@laanwj laanwj added the P2P label Nov 17, 2015
@dcousens
Copy link
Contributor Author

Rebased and now uses LogPrint (instead of LogPrintf and LogAccept)

@maflcko
Copy link
Member

maflcko commented Nov 18, 2015

I think this solution is fine.

utACK 3d8792f

Would be somewhat better to detect if there was a connection in the first place, and to always log a message if there was, and log a different message only w/ debug=tor if there wasn't (as this is only useful for troubleshooting).

Can be another PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we intend to keep this message unconditional, we should make it "Not connected to Tor control port" as @petertodd suggests in #7032. This doesn't imply being connected before.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@laanwj agreed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@laanwj shall it be done in this PR?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dcousens Yes, because the "if there was a connection in the first place" logic is not here yet.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's one or the other:

  • Make the logic determine whether there was a connection, report if there was one and it was lost, report a different message if we're re-trying to connect because connection failed
  • Change to a blanket message that covers both cases

If not, people that have -debug=tor enabled can still complain that the message is not correct.
The second is just a matter of changing a message so should be done in this PR, IMO.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dcousens ping

@sipa
Copy link
Member

sipa commented Nov 28, 2015

Needs rebase.

@laanwj
Copy link
Member

laanwj commented Nov 30, 2015

Needs rebase and nit fix.

@dcousens
Copy link
Contributor Author

@laanwj on it, just haven't had time yet. Tomorrow 👍
(It was waiting on #7058, but now that's merged, its just blocked by me)

@laanwj laanwj merged commit 4531fc4 into bitcoin:master Nov 30, 2015
laanwj added a commit that referenced this pull request Nov 30, 2015
4531fc4 torcontrol: only output disconnect if -debug=tor (Daniel Cousens)
@dcousens dcousens deleted the torlog branch December 1, 2015 00:30
@dcousens
Copy link
Contributor Author

dcousens commented Dec 1, 2015

@laanwj your comment is still relevant, but maybe another PR.

@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants