Fixes #19676, “For every peer expose through getpeerinfo RPC whether or not we selected them as HB peers, and whether or not they selected us as HB peers.” See BIP152, in particular the protocol flow diagram. The newly introduced states are changed on the following places in the code:
- on reception of a
SENDCMPCT
message with valid version, the fieldm_highbandwidth_from
is changed depending on the first integer parameter in the message (1=high bandwidth, 0=low bandwidth), i.e. it just mirrors the fieldCNodeState.fPreferHeaderAndIDs
. - after adding a
SENDCMPCT
message to the send queue, the fieldm_highbandwidth_to
is changed depending on how the first integer parameter is set (same as above)
Note that after receiving VERACK
, the node also sends SENDCMPCT
, but that is only to announce the preferred version and never selects high-bandwidth mode, hence there is no need to change the state variables there, which are initialized to false
anyways.