Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
New connection strategy #1911
Partially resolves #1753
This PR adds new outboundvalid field to PeerRecord that is stored in database. outboundvalid means that at least once it was possible to make valid outbound connection to that peer. Peers with outboundvalid flags are first to try to join to and first to send to other peers as a response to GETPEERS message.
This PR also makes MAX_PENDING_PEERS setting only applicable to incoming connections, as OverlayManagerImpl already has logic for initiating only proper number of outgoing connections at any time, and it would be bad to have all PENDING slots taken by inbound connection from misbehaving peers.
referenced this pull request
Jan 16, 2019
overall a lot better than the previous PR. A few comments, biggest change needed is around configuration: we have to preserve backward compatibility with this change (and have a sane default behavior for people using an existing configuration file)
What do you think of different database change? Currently preferred implies that peer is outbound, and we could have this implication in database:
flags -> type, where type = 0 (inbound), 1 (outbound), 2 (preferred).
We could add index on new type column and do not create outbound one.
as you've removed
I noticed that many tests in acceptance fail because of that.