Skip to content

DB.Connect panics with nil pointer dereference when P2P is disabled #5226

Description

@ChrisBQu

The DB.Connect function inside internal/db/p2p.go lacks a db.p2p == nil check that is present in its sibling Disconnect function. If you start a node with P2P disabled, db.p2p will remain nil. As a result, a call made ondb.p2p.Connect will panic.

Over HTTP, this will degrade to a 500 error. However, on embedded clients, this will result in a crash.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions