Skip to content

Commit

Permalink
Merge branch 'backport/D5830' into 'master'
Browse files Browse the repository at this point in the history
[backport] Rename IsGood() to IsReliable()

See merge request bitcoin-cash-node/bitcoin-cash-node!407
  • Loading branch information
dagurval committed May 27, 2020
2 parents 834bb92 + 07c3a4d commit e3cb413
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/seeder/db.cpp
Expand Up @@ -97,7 +97,7 @@ void CAddrDb::Good_(const CService &addr, int clientV, const std::string &client
info.clientSubVersion = clientSV;
info.blocks = blocks;
info.Update(true);
if (info.IsGood() && goodId.count(id) == 0) {
if (info.IsReliable() && goodId.count(id) == 0) {
goodId.insert(id);
// fprintf(stdout, "%s: good; %i good nodes now\n",
// ToString(addr).c_str(), (int)goodId.size());
Expand Down Expand Up @@ -130,7 +130,7 @@ void CAddrDb::Bad_(const CService &addr, int ban) {
goodId.erase(id);
idToInfo.erase(id);
} else {
if (/*!info.IsGood() && */ goodId.count(id) == 1) {
if (/*!info.IsReliable() && */ goodId.count(id) == 1) {
goodId.erase(id);
// fprintf(stdout, "%s: not good; %i good nodes left\n",
// ToString(addr).c_str(), (int)goodId.size());
Expand Down
10 changes: 5 additions & 5 deletions src/seeder/db.h
Expand Up @@ -112,12 +112,12 @@ class CAddrInfo {
ret.uptime[3] = stat1W.reliability;
ret.uptime[4] = stat1M.reliability;
ret.lastSuccess = ourLastSuccess;
ret.fGood = IsGood();
ret.fGood = IsReliable();
ret.services = services;
return ret;
}

bool IsGood() const {
bool IsReliable() const {
if (ip.GetPort() != GetDefaultPort()) {
return false;
}
Expand Down Expand Up @@ -158,7 +158,7 @@ class CAddrInfo {
}

int64_t GetBanTime() const {
if (IsGood()) {
if (IsReliable()) {
return 0;
}
if (clientVersion && clientVersion < 31900) {
Expand All @@ -180,7 +180,7 @@ class CAddrInfo {
}

int64_t GetIgnoreTime() const {
if (IsGood()) {
if (IsReliable()) {
return 0;
}
if (stat1M.reliability - stat1M.weight + 1.0 < 0.20 &&
Expand Down Expand Up @@ -399,7 +399,7 @@ class CAddrDb {
db->ipToId[info.ip] = id;
if (info.ourLastTry) {
db->ourId.push_back(id);
if (info.IsGood()) {
if (info.IsReliable()) {
db->goodId.insert(id);
}
} else {
Expand Down

0 comments on commit e3cb413

Please sign in to comment.