HomePhabricator

[avalanche] Fix occasional invalid node count in getavalancheinfo

Description

[avalanche] Fix occasional invalid node count in getavalancheinfo

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

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D11793

Details

Provenance
FabienAuthored on Jul 22 2022, 12:39
FabienPushed on Jul 22 2022, 16:25
Reviewer
Restricted Project
Differential Revision
D11793: [avalanche] Fix occasional invalid node count in getavalancheinfo
Parents
rABC10843101904e: Avoid UBSan warning in ProcessMessage(...) and disallow negative mocktime
Branches
Unknown
Tags
Unknown