mirror of https://github.com/oxen-io/lokinet
Remove unused arguments (and ants)
This commit is contained in:
parent
2c827870c9
commit
6e05dc693f
|
@ -49,7 +49,7 @@ namespace llarp
|
|||
AddLink(LinkLayer_ptr link, bool inbound = false) = 0;
|
||||
|
||||
virtual bool
|
||||
StartLinks(const EventLoop_ptr& loop) = 0;
|
||||
StartLinks() = 0;
|
||||
|
||||
virtual void
|
||||
Stop() = 0;
|
||||
|
|
|
@ -121,12 +121,12 @@ namespace llarp
|
|||
}
|
||||
|
||||
bool
|
||||
LinkManager::StartLinks(const EventLoop_ptr& loop)
|
||||
LinkManager::StartLinks()
|
||||
{
|
||||
LogInfo("starting ", outboundLinks.size(), " outbound links");
|
||||
for (const auto& link : outboundLinks)
|
||||
{
|
||||
if (!link->Start(loop))
|
||||
if (!link->Start())
|
||||
{
|
||||
LogWarn("outbound link '", link->Name(), "' failed to start");
|
||||
return false;
|
||||
|
@ -139,7 +139,7 @@ namespace llarp
|
|||
LogInfo("starting ", inboundLinks.size(), " inbound links");
|
||||
for (const auto& link : inboundLinks)
|
||||
{
|
||||
if (!link->Start(loop))
|
||||
if (!link->Start())
|
||||
{
|
||||
LogWarn("Link ", link->Name(), " failed to start");
|
||||
return false;
|
||||
|
|
|
@ -47,7 +47,7 @@ namespace llarp
|
|||
AddLink(LinkLayer_ptr link, bool inbound = false) override;
|
||||
|
||||
bool
|
||||
StartLinks(const EventLoop_ptr& loop) override;
|
||||
StartLinks() override;
|
||||
|
||||
void
|
||||
Stop() override;
|
||||
|
|
|
@ -339,11 +339,11 @@ namespace llarp
|
|||
}
|
||||
|
||||
bool
|
||||
ILinkLayer::Start(const EventLoop_ptr& loop)
|
||||
ILinkLayer::Start()
|
||||
{
|
||||
// Tie the lifetime of this repeater to this arbitrary shared_ptr:
|
||||
m_repeater_keepalive = std::make_shared<int>(0);
|
||||
loop->call_every(LINK_LAYER_TICK_INTERVAL, m_repeater_keepalive, [this] { Tick(Now()); });
|
||||
m_Loop->call_every(LINK_LAYER_TICK_INTERVAL, m_repeater_keepalive, [this] { Tick(Now()); });
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ namespace llarp
|
|||
TryEstablishTo(RouterContact rc);
|
||||
|
||||
bool
|
||||
Start(const EventLoop_ptr& loop);
|
||||
Start();
|
||||
|
||||
virtual void
|
||||
Stop();
|
||||
|
|
|
@ -156,7 +156,6 @@ namespace llarp
|
|||
if (rc.IsPublicRouter())
|
||||
{
|
||||
LogDebug("Adding or updating RC for ", RouterID(rc.pubkey), " to nodedb and dht.");
|
||||
const RouterContact copy{rc};
|
||||
_loop->call([rc, n = _nodedb] { n->PutIfNewer(rc); });
|
||||
_dht->impl->PutRCNodeAsync(rc);
|
||||
}
|
||||
|
|
|
@ -1057,7 +1057,7 @@ namespace llarp
|
|||
}
|
||||
}
|
||||
_outboundSessionMaker.SetOurRouter(pubkey());
|
||||
if (!_linkManager.StartLinks(_loop))
|
||||
if (!_linkManager.StartLinks())
|
||||
{
|
||||
LogWarn("One or more links failed to start.");
|
||||
return false;
|
||||
|
|
|
@ -117,7 +117,7 @@ struct IWPLinkContext
|
|||
|
||||
if (inbound)
|
||||
{
|
||||
// only add address info on the recipiant's rc
|
||||
// only add address info on the recipient's rc
|
||||
rc.addrs.emplace_back();
|
||||
REQUIRE(link->GetOurAddressInfo(rc.addrs.back()));
|
||||
}
|
||||
|
@ -166,19 +166,19 @@ RunIWPTest(Func_t test, Duration_t timeout = 10s)
|
|||
// set up client
|
||||
auto initiator = std::make_shared<IWPLinkContext>("127.0.0.1:3001", loop);
|
||||
// set up server
|
||||
auto recipiant = std::make_shared<IWPLinkContext>("127.0.0.1:3002", loop);
|
||||
auto recipient = std::make_shared<IWPLinkContext>("127.0.0.1:3002", loop);
|
||||
|
||||
// function for ending unit test on success
|
||||
auto endIfDone = [initiator, recipiant, loop]() {
|
||||
if (initiator->gucci and recipiant->gucci)
|
||||
auto endIfDone = [initiator, recipient, loop]() {
|
||||
if (initiator->gucci and recipient->gucci)
|
||||
{
|
||||
loop->stop();
|
||||
}
|
||||
};
|
||||
// function to start test and give loop to unit test
|
||||
auto start = [initiator, recipiant, loop]() {
|
||||
REQUIRE(initiator->link->Start(loop));
|
||||
REQUIRE(recipiant->link->Start(loop));
|
||||
auto start = [initiator, recipient, loop]() {
|
||||
REQUIRE(initiator->link->Start());
|
||||
REQUIRE(recipient->link->Start());
|
||||
return loop;
|
||||
};
|
||||
|
||||
|
@ -186,7 +186,7 @@ RunIWPTest(Func_t test, Duration_t timeout = 10s)
|
|||
auto endTest = [loop] { loop->stop(); };
|
||||
|
||||
loop->call_later(timeout, [] { FAIL("test timeout"); });
|
||||
test(start, endIfDone, endTest, initiator, recipiant);
|
||||
test(start, endIfDone, endTest, initiator, recipient);
|
||||
loop->run();
|
||||
llarp::RouterContact::BlockBogons = oldBlockBogons;
|
||||
}
|
||||
|
@ -205,7 +205,7 @@ TEST_CASE("IWP handshake", "[iwp]")
|
|||
alice->gucci = true;
|
||||
endIfDone();
|
||||
});
|
||||
// set up recipiant
|
||||
// set up recipient
|
||||
bob->InitLink<true>([=](auto remote) {
|
||||
REQUIRE(remote->GetRemoteRC() == alice->rc);
|
||||
bob->gucci = true;
|
||||
|
|
Loading…
Reference in New Issue