chore: only report "bad" connection when it's actually bad (#5680)

## Issue being fixed or feature implemented
Having `<protxhash> is not connected to us, badConnection=0` doesn't
help when we don't expect it to be connected 🤷‍♂️

## What was done?


## How Has This Been Tested?


## Breaking Changes
n/a

## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone _(for repository
code-owners and collaborators only)_
This commit is contained in:
UdjinM6 2023-11-07 16:41:27 +03:00 committed by GitHub
parent c61fe0aacd
commit 6253aa2fec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -457,7 +457,9 @@ void CDKGSession::VerifyConnectionAndMinProtoVersions() const
}
if (auto it = protoMap.find(m->dmn->proTxHash); it == protoMap.end()) {
m->badConnection = fShouldAllMembersBeConnected;
logger.Batch("%s is not connected to us, badConnection=%b", m->dmn->proTxHash.ToString(), m->badConnection);
if (m->badConnection) {
logger.Batch("%s is not connected to us, badConnection=1", m->dmn->proTxHash.ToString());
}
} else if (it->second < MIN_MASTERNODE_PROTO_VERSION) {
m->badConnection = true;
logger.Batch("%s does not have min proto version %d (has %d)", m->dmn->proTxHash.ToString(), MIN_MASTERNODE_PROTO_VERSION, it->second);