MCPcopy Create free account
hub / github.com/LUX-Core/lux / auth_cb

Method auth_cb

src/luxcontrol.cpp:501–527  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

499}
500
501void LuxController::auth_cb(LuxControlConnection& _conn, const LuxControlReply& reply)
502{
503 if (reply.code == 250) {
504 LogPrint("lux", "lux: Authentication successful\n");
505
506 // Now that we know Lux is running setup the proxy for onion addresses
507 // if -onion isn't set to something else.
508 if (GetArg("-onion", "") == "") {
509 CService resolved;
510 assert(LookupNumeric("127.0.0.1", resolved, 9050));
511 CService addrOnion = CService(resolved, 9050);
512 SetProxy(NET_TOR, addrOnion);
513 SetLimited(NET_TOR, false);
514 }
515
516 // Finally - now create the service
517 if (private_key.empty()) // No private key, generate one
518 private_key = "NEW:RSA1024"; // Explicitly request RSA1024 - see issue #9214
519 // Request hidden service, redirect port.
520 // Note that the 'virtual' port doesn't have to be the same as our internal port, but this is just a convenient
521 // choice. TODO; refactor the shutdown sequence some day.
522 _conn.Command(strprintf("ADD_ONION %s Port=%i,127.0.0.1:%i", private_key, GetListenPort(), GetListenPort()),
523 boost::bind(&LuxController::add_onion_cb, this, _1, _2));
524 } else {
525 LogPrintf("lux: Authentication failed\n");
526 }
527}
528
529/** Compute Lux SAFECOOKIE response.
530 *

Callers

nothing calls this directly

Calls 9

LogPrintFunction · 0.85
GetArgFunction · 0.85
LookupNumericFunction · 0.85
SetProxyFunction · 0.85
SetLimitedFunction · 0.85
GetListenPortFunction · 0.85
CommandMethod · 0.80
CServiceClass · 0.70
emptyMethod · 0.45

Tested by

no test coverage detected