Is a peer connection maintained for the life of the node, or is it recreated on every request?

0

Lets assume we have 2 bitcoin nodes, A and B. A is already up, and B is now coming up. B lists A as a peer node and attempts to establish a connection. A accepts, a handshake is completed and they confirm they are in sync. Is the connection then terminated until there is a need to communicate with each-other again (ie a new transaction is broadcast)? Or is the connection persisted for the life time of the application?

If it is persisted, what prevents a well known public node from being swarmed with peer requests?

David says Reinstate Monica

Posted 2018-06-21T23:39:11.290

Reputation: 145

Answers

2

Or is the connection persisted for the life time of the application?

Persistent. Subsequent messages will be transmitted across the same connection.

If it is persisted, what prevents a well known public node from being swarmed with peer requests?

The Core implementation has a Connection Manager that increments the ban score for a peer if the peer behaves erroneously (e.g. spamming peer requests). Once a ban score of 100 has been accrued, the peer will be disconnected and banned from connecting until ban time window has been served.

renlord

Posted 2018-06-21T23:39:11.290

Reputation: 2 167