Skip to content

bitcoin-wallet requires write permissions when unneeded #29559

@BebeSparkelSparkel

Description

@BebeSparkelSparkel

Is there an existing issue for this?

  • I have searched the existing issues

Current behaviour

I have some wallets that are write protected and want to use bitcoin-wallet info and bitcoin-wallet dump but am unable to do so because these commands require write permission.

$ bitcoin-wallet -datadir=. -wallet=wallet-name -dumpfile=wallet.dump dump
SQLiteDatabase: Database opened in readonly mode but read-write permissions are needed
$ bitcoin-wallet -datadir=. -wallet=wallet-name info                     
SQLiteDatabase: Database opened in readonly mode but read-write permissions are needed

Expected behaviour

I would expect commands that are not intended to change the wallet to only require read permissions and be able to work on wallet directories and files that are read only.

This will also stop mistakes from corrupting the database.

Steps to reproduce

chmod -R a-w <wallet-directory>
bitcoin-wallet -datadir=<wallet-directory> -wallet=<wallet-name> -dumpfile=wallet.dump dump
bitcoin-wallet -datadir=<wallet-directory> -wallet=<wallet-name> info

Relevant log output

No response

How did you obtain Bitcoin Core

Package manager

What version of Bitcoin Core are you using?

v25.0.0

Operating system and version

OpenBSD 7.4 Stable

Machine specifications

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions