Changeset View
Changeset View
Standalone View
Standalone View
src/seeder/db.cpp
Show First 20 Lines • Show All 132 Lines • ▼ Show 20 Lines | if (ban > 0) { | ||||
// fprintf(stdout, "%s: not good; %i good nodes left\n", | // fprintf(stdout, "%s: not good; %i good nodes left\n", | ||||
// ToString(addr).c_str(), (int)goodId.size()); | // ToString(addr).c_str(), (int)goodId.size()); | ||||
} | } | ||||
ourId.push_back(id); | ourId.push_back(id); | ||||
} | } | ||||
nDirty++; | nDirty++; | ||||
} | } | ||||
void CAddrDb::Skipped_(const CService &addr) { | |||||
int id = Lookup_(addr); | |||||
if (id == -1) { | |||||
return; | |||||
} | |||||
unkId.erase(id); | |||||
ourId.push_back(id); | |||||
// fprintf(stdout, "%s: skipped\n", ToString(addr).c_str()); | |||||
nDirty++; | |||||
} | |||||
void CAddrDb::Add_(const CAddress &addr, bool force) { | void CAddrDb::Add_(const CAddress &addr, bool force) { | ||||
if (!force && !addr.IsRoutable()) { | if (!force && !addr.IsRoutable()) { | ||||
return; | return; | ||||
} | } | ||||
CService ipp(addr); | CService ipp(addr); | ||||
if (banned.count(ipp)) { | if (banned.count(ipp)) { | ||||
time_t bantime = banned[ipp]; | time_t bantime = banned[ipp]; | ||||
if (force || (bantime < time(nullptr) && addr.nTime > bantime)) { | if (force || (bantime < time(nullptr) && addr.nTime > bantime)) { | ||||
▲ Show 20 Lines • Show All 84 Lines • Show Last 20 Lines |