@@ -94,7 +94,7 @@ void TorControlConnection::readcb(struct bufferevent *bev, void *ctx)
94
94
self->reply_handlers .front ()(*self, self->message );
95
95
self->reply_handlers .pop_front ();
96
96
} else {
97
- LogPrint (BCLog::TOR, " tor: Received unexpected sync reply %i\n " , self->message .code );
97
+ LogPrint (BCLog::TOR, " Received unexpected sync reply %i\n " , self->message .code );
98
98
}
99
99
}
100
100
self->message .Clear ();
@@ -113,13 +113,13 @@ void TorControlConnection::eventcb(struct bufferevent *bev, short what, void *ct
113
113
{
114
114
TorControlConnection *self = static_cast <TorControlConnection*>(ctx);
115
115
if (what & BEV_EVENT_CONNECTED) {
116
- LogPrint (BCLog::TOR, " tor: Successfully connected!\n " );
116
+ LogPrint (BCLog::TOR, " Successfully connected!\n " );
117
117
self->connected (*self);
118
118
} else if (what & (BEV_EVENT_EOF|BEV_EVENT_ERROR)) {
119
119
if (what & BEV_EVENT_ERROR) {
120
- LogPrint (BCLog::TOR, " tor: Error connecting to Tor control socket\n " );
120
+ LogPrint (BCLog::TOR, " Error connecting to Tor control socket\n " );
121
121
} else {
122
- LogPrint (BCLog::TOR, " tor: End of stream\n " );
122
+ LogPrint (BCLog::TOR, " End of stream\n " );
123
123
}
124
124
self->Disconnect ();
125
125
self->disconnected (*self);
@@ -318,7 +318,7 @@ TorController::TorController(struct event_base* _base, const std::string& tor_co
318
318
// Read service private key if cached
319
319
std::pair<bool ,std::string> pkf = ReadBinaryFile (GetPrivateKeyFile ());
320
320
if (pkf.first ) {
321
- LogPrint (BCLog::TOR, " tor: Reading cached private key from %s\n " , fs::PathToString (GetPrivateKeyFile ()));
321
+ LogPrint (BCLog::TOR, " Reading cached private key from %s\n " , fs::PathToString (GetPrivateKeyFile ()));
322
322
private_key = pkf.second ;
323
323
}
324
324
}
@@ -359,7 +359,7 @@ void TorController::get_socks_cb(TorControlConnection& _conn, const TorControlRe
359
359
}
360
360
}
361
361
if (!socks_location.empty ()) {
362
- LogPrint (BCLog::TOR, " tor: Get SOCKS port command yielded %s\n " , socks_location);
362
+ LogPrint (BCLog::TOR, " Get SOCKS port command yielded %s\n " , socks_location);
363
363
} else {
364
364
LogPrintf (" tor: Get SOCKS port command returned nothing\n " );
365
365
}
@@ -380,7 +380,7 @@ void TorController::get_socks_cb(TorControlConnection& _conn, const TorControlRe
380
380
}
381
381
382
382
Assume (resolved.IsValid ());
383
- LogPrint (BCLog::TOR, " tor: Configuring onion proxy for %s\n " , resolved.ToStringIPPort ());
383
+ LogPrint (BCLog::TOR, " Configuring onion proxy for %s\n " , resolved.ToStringIPPort ());
384
384
Proxy addrOnion = Proxy (resolved, true );
385
385
SetProxy (NET_ONION, addrOnion);
386
386
@@ -404,7 +404,7 @@ void TorController::get_socks_cb(TorControlConnection& _conn, const TorControlRe
404
404
void TorController::add_onion_cb (TorControlConnection& _conn, const TorControlReply& reply)
405
405
{
406
406
if (reply.code == 250 ) {
407
- LogPrint (BCLog::TOR, " tor: ADD_ONION successful\n " );
407
+ LogPrint (BCLog::TOR, " ADD_ONION successful\n " );
408
408
for (const std::string &s : reply.lines ) {
409
409
std::map<std::string,std::string> m = ParseTorReplyMapping (s);
410
410
std::map<std::string,std::string>::iterator i;
@@ -423,7 +423,7 @@ void TorController::add_onion_cb(TorControlConnection& _conn, const TorControlRe
423
423
service = LookupNumeric (std::string (service_id+" .onion" ), Params ().GetDefaultPort ());
424
424
LogPrintf (" tor: Got service ID %s, advertising service %s\n " , service_id, service.ToString ());
425
425
if (WriteBinaryFile (GetPrivateKeyFile (), private_key)) {
426
- LogPrint (BCLog::TOR, " tor: Cached service private key to %s\n " , fs::PathToString (GetPrivateKeyFile ()));
426
+ LogPrint (BCLog::TOR, " Cached service private key to %s\n " , fs::PathToString (GetPrivateKeyFile ()));
427
427
} else {
428
428
LogPrintf (" tor: Error writing service private key to %s\n " , fs::PathToString (GetPrivateKeyFile ()));
429
429
}
@@ -439,7 +439,7 @@ void TorController::add_onion_cb(TorControlConnection& _conn, const TorControlRe
439
439
void TorController::auth_cb (TorControlConnection& _conn, const TorControlReply& reply)
440
440
{
441
441
if (reply.code == 250 ) {
442
- LogPrint (BCLog::TOR, " tor: Authentication successful\n " );
442
+ LogPrint (BCLog::TOR, " Authentication successful\n " );
443
443
444
444
// Now that we know Tor is running setup the proxy for onion addresses
445
445
// if -onion isn't set to something else.
@@ -490,7 +490,7 @@ static std::vector<uint8_t> ComputeResponse(const std::string &key, const std::v
490
490
void TorController::authchallenge_cb (TorControlConnection& _conn, const TorControlReply& reply)
491
491
{
492
492
if (reply.code == 250 ) {
493
- LogPrint (BCLog::TOR, " tor: SAFECOOKIE authentication challenge successful\n " );
493
+ LogPrint (BCLog::TOR, " SAFECOOKIE authentication challenge successful\n " );
494
494
std::pair<std::string,std::string> l = SplitTorReplyLine (reply.lines [0 ]);
495
495
if (l.first == " AUTHCHALLENGE" ) {
496
496
std::map<std::string,std::string> m = ParseTorReplyMapping (l.second );
@@ -500,7 +500,7 @@ void TorController::authchallenge_cb(TorControlConnection& _conn, const TorContr
500
500
}
501
501
std::vector<uint8_t > serverHash = ParseHex (m[" SERVERHASH" ]);
502
502
std::vector<uint8_t > serverNonce = ParseHex (m[" SERVERNONCE" ]);
503
- LogPrint (BCLog::TOR, " tor: AUTHCHALLENGE ServerHash %s ServerNonce %s\n " , HexStr (serverHash), HexStr (serverNonce));
503
+ LogPrint (BCLog::TOR, " AUTHCHALLENGE ServerHash %s ServerNonce %s\n " , HexStr (serverHash), HexStr (serverNonce));
504
504
if (serverNonce.size () != 32 ) {
505
505
LogPrintf (" tor: ServerNonce is not 32 bytes, as required by spec\n " );
506
506
return ;
@@ -547,12 +547,12 @@ void TorController::protocolinfo_cb(TorControlConnection& _conn, const TorContro
547
547
std::map<std::string,std::string> m = ParseTorReplyMapping (l.second );
548
548
std::map<std::string,std::string>::iterator i;
549
549
if ((i = m.find (" Tor" )) != m.end ()) {
550
- LogPrint (BCLog::TOR, " tor: Connected to Tor version %s\n " , i->second );
550
+ LogPrint (BCLog::TOR, " Connected to Tor version %s\n " , i->second );
551
551
}
552
552
}
553
553
}
554
554
for (const std::string &s : methods) {
555
- LogPrint (BCLog::TOR, " tor: Supported authentication method: %s\n " , s);
555
+ LogPrint (BCLog::TOR, " Supported authentication method: %s\n " , s);
556
556
}
557
557
// Prefer NULL, otherwise SAFECOOKIE. If a password is provided, use HASHEDPASSWORD
558
558
/* Authentication:
@@ -562,18 +562,18 @@ void TorController::protocolinfo_cb(TorControlConnection& _conn, const TorContro
562
562
std::string torpassword = gArgs .GetArg (" -torpassword" , " " );
563
563
if (!torpassword.empty ()) {
564
564
if (methods.count (" HASHEDPASSWORD" )) {
565
- LogPrint (BCLog::TOR, " tor: Using HASHEDPASSWORD authentication\n " );
565
+ LogPrint (BCLog::TOR, " Using HASHEDPASSWORD authentication\n " );
566
566
ReplaceAll (torpassword, " \" " , " \\\" " );
567
567
_conn.Command (" AUTHENTICATE \" " + torpassword + " \" " , std::bind (&TorController::auth_cb, this , std::placeholders::_1, std::placeholders::_2));
568
568
} else {
569
569
LogPrintf (" tor: Password provided with -torpassword, but HASHEDPASSWORD authentication is not available\n " );
570
570
}
571
571
} else if (methods.count (" NULL" )) {
572
- LogPrint (BCLog::TOR, " tor: Using NULL authentication\n " );
572
+ LogPrint (BCLog::TOR, " Using NULL authentication\n " );
573
573
_conn.Command (" AUTHENTICATE" , std::bind (&TorController::auth_cb, this , std::placeholders::_1, std::placeholders::_2));
574
574
} else if (methods.count (" SAFECOOKIE" )) {
575
575
// Cookie: hexdump -e '32/1 "%02x""\n"' ~/.tor/control_auth_cookie
576
- LogPrint (BCLog::TOR, " tor: Using SAFECOOKIE authentication, reading cookie authentication from %s\n " , cookiefile);
576
+ LogPrint (BCLog::TOR, " Using SAFECOOKIE authentication, reading cookie authentication from %s\n " , cookiefile);
577
577
std::pair<bool ,std::string> status_cookie = ReadBinaryFile (fs::PathFromString (cookiefile), TOR_COOKIE_SIZE);
578
578
if (status_cookie.first && status_cookie.second .size () == TOR_COOKIE_SIZE) {
579
579
// _conn.Command("AUTHENTICATE " + HexStr(status_cookie.second), std::bind(&TorController::auth_cb, this, std::placeholders::_1, std::placeholders::_2));
@@ -615,7 +615,7 @@ void TorController::disconnected_cb(TorControlConnection& _conn)
615
615
if (!reconnect)
616
616
return ;
617
617
618
- LogPrint (BCLog::TOR, " tor: Not connected to Tor control port %s, trying to reconnect\n " , m_tor_control_center);
618
+ LogPrint (BCLog::TOR, " Not connected to Tor control port %s, trying to reconnect\n " , m_tor_control_center);
619
619
620
620
// Single-shot timer for reconnect. Use exponential backoff.
621
621
struct timeval time = MillisToTimeval (int64_t (reconnect_timeout * 1000.0 ));
0 commit comments