Currently our wallet-tool
performs a few “read-only” operations (info
, dump
) on sqlite databases. However, currently this involves opening the wallet in RW mode, with the side-effects of modifying the wallet file, and failing to open a “read-only” wallet file.
See #15608 for more context.
Since we have dropped the BDB wallet, this change got a lot simpler; the BDB parser is now custom and only operates in read-only mode anyway.
This change adds a read_only
bool to DatabaseOptions
. This can be used by the sqlite dbwrapper to open the database in readonly mode.
Includes tests to verify indempotence of wallet tool “read only” operations.
Fixes: #15608