Skip to content

Use .lock file for data directory #1989

@michael1011

Description

@michael1011

When playing with two XUDs on a local regtest network, I noticed that they were using the same database and node public key. This is not a critical issue since I don't think that this could cause data corruption of any files, but it is an inconvenience that XUD does not prevent that from happening. There is no use case for using the same data directory for two nodes at the same time, so we should not let XUD do that since it could cause some weird behaviour.

What I propose is creating an empty .lock file for the data directory (or maybe node public key and database file) on startup and removing that file when XUD shuts down. When XUD detects that such a file exists, it should abort the startup and log that there might be an XUD running with that data directory already

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3low prioritydatabaseDatabase related issuesenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions