You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When there are no peers and we try to add `FD_GUI_MAX_PEER_CNT` peers,
`gui->gossip.peer_cnt` would previously be stuck at `FD_GUI_MAX_PEER_CNT-1` due to
the saturating arithmetic.
The effect is that ALL `FD_GUI_MAX_PEER_CNT` peers of the input `msg` would be _copied_
into the `peers` array, but the last peer would be effectively ignored since the
`gui->gossip.peer_cnt` would not reflect its addition.
The value of `gui->gossip.peer_cnt` is now allowed to go up to `FD_GUI_MAX_PEER_CNT`,
so that all `FD_GUI_MAX_PEER_CNT` peers can be added when starting from zero peers.
The testing and bail-out when `gui->gossip.peer_cnt` is the maximum is unnecessary, due
to the removal logic which ensures that the peer count can never exceed the maximum.
0 commit comments