Skip to content

Commit

Permalink
Merge bitcoin#13532: Log warning when deprecated network name 'tor' i…
Browse files Browse the repository at this point in the history
…s used

9f8c54b Log warning message when deprecated network name 'tor' is used (e.g. option onlynet=tor) (wodry)

Pull request description:

  As @laanwj mentioned [here](bitcoin#13418 (comment)), using option `onlynet=tor` is deprecated.

  I think it would be good to give the user a depcreaction warning feedback, so users can switch to `onlynet=onion` so there is a perspective for removing the deprecated `tor` in the future to decrease confusion.

  Currently, users maybe just wonder that they can use a undocumented option, or they are not aware that they use a deprecated option.

  Alternatively for the log warning message, I think at least this deprecetaion should be documented in the source code in a comment for readers of the source code.

Tree-SHA512: f4889793cdd62a0a13353e13994ed50ca7d367fa9da9897ce909f86cf0b0ce6151b3c484c8e514b8ac332949c6bbc71001e06e918248a1089f73756bd4840602
  • Loading branch information
laanwj authored and PastaPastaPasta committed Jun 9, 2020
1 parent 409238b commit 0f7f679
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/netbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ enum Network ParseNetwork(std::string net) {
boost::to_lower(net);
if (net == "ipv4") return NET_IPV4;
if (net == "ipv6") return NET_IPV6;
if (net == "tor" || net == "onion") return NET_TOR;
if (net == "onion") return NET_TOR;
if (net == "tor") {
LogPrintf("Warning: net name 'tor' is deprecated and will be removed in the future. You should use 'onion' instead.\n");
return NET_TOR;
}
return NET_UNROUTABLE;
}

Expand Down

0 comments on commit 0f7f679

Please sign in to comment.