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

Function Threadlimitpeers

src/net.cpp:1596–1615  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1594
1595void limit_peers(int i);
1596void Threadlimitpeers(){
1597
1598 if(mapArgs.count("-peerlimit")){ // don't read what is not readable
1599 std::string str = mapArgs["-peerlimit"];
1600 int num = std::stoi( str );
1601
1602 if (num==0){ // peer sync limit off. mapArgs should do the job but, peerlimit=0 is more reassuring to the user then peerlimit not being there
1603 return;
1604 }
1605
1606 if (num <= 3){ // don't allow less then 4 peers
1607 num = 4;
1608 }
1609
1610 for ( ; getVerificationProgress(NULL) < 0.999 ; ){ // 99.9%
1611 limit_peers(num);
1612 MilliSleep(1000);
1613 }
1614 }
1615}
1616
1617void limit_peers(int i)
1618{

Callers

nothing calls this directly

Calls 4

getVerificationProgressFunction · 0.85
limit_peersFunction · 0.85
MilliSleepFunction · 0.85
countMethod · 0.45

Tested by

no test coverage detected