Page MenuHomePhabricator

[avalanche] Fix occasional invalid node count in getavalancheinfo
ClosedPublic

Authored by Fabien on Jul 22 2022, 13:19.

Details

Summary

The connected node count is actually retrieved from the node set size rather than counting the nodes attached to peers. Unde some special circumstances, where a node recently polled disconnects, the node structure is not immediately removed so if it reconnects shortly we don't drop the avacooldown value and overquery it. In this case the values returned by the RPC can be wrong and confusing. Otherwise there is no change in behavior.

Test Plan
./test/functional/test_runner.py abc_rpc_getavalancheinfo

Diff Detail

Repository
rABC Bitcoin ABC
Branch
avalanche_getavalancheinfo_nodecount
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 19703
Build 39125: Build Difflint-circular-dependencies · build-debug · build-clang-tidy · build-clang · build-diff · build-without-wallet
Build 39124: arc lint + arc unit

Event Timeline

Fabien requested review of this revision.Jul 22 2022, 13:19
This revision is now accepted and ready to land.Jul 22 2022, 15:49
src/rpc/avalanche.cpp
780

Maybe this should be either removed or renamed.