Added a SevError trace event in case peer references becomes negative

This commit is contained in:
Evan Tschannen 2018-07-10 13:26:28 -07:00
parent c25be5699a
commit a35d5e30d9
1 changed files with 3 additions and 0 deletions

View File

@ -829,6 +829,9 @@ void FlowTransport::removePeerReference( const Endpoint& endpoint, NetworkMessag
Peer* peer = self->getPeer(endpoint.address, false); Peer* peer = self->getPeer(endpoint.address, false);
if(peer) { if(peer) {
peer->peerReferences--; peer->peerReferences--;
if(peer->peerReferences < 0) {
TraceEvent(SevError, "InvalidPeerReferences").detail("References", peer->peerReferences).detail("Address", endpoint.address).detail("Token", endpoint.token);
}
if(peer->peerReferences == 0 && peer->reliable.empty() && peer->unsent.empty()) { if(peer->peerReferences == 0 && peer->reliable.empty() && peer->unsent.empty()) {
peer->incompatibleDataRead.trigger(); peer->incompatibleDataRead.trigger();
} }