Skip to content
This repository was archived by the owner on Oct 28, 2021. It is now read-only.
This repository was archived by the owner on Oct 28, 2021. It is now read-only.

Aleth doesn't disconnect peer session when all capabilities are disabled  #5674

@halfalicious

Description

@halfalicious

Aleth disables the "eth" capability for a peer when certain conditions occur e.g. Aleth receives a new block from a peer which is malformed. However, the network session is kept alive despite the capability being disabled (note that Aleth only supports the eth capability so disabling it means the connected peer is useless) since Session's doRead loop (which performs an async read from a socket) passes a shared_ptr instance of the Session to the async_read handler, which means that the Session will be kept alive until the peer disconnects. Note that Host also pings peer sessions periodically to keep them alive (see Host::keepAlivePeers), so it's possible that a session could remain connected a long time after all capabilities have been disabled on it.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions