aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/salvage.cpp
AgeCommit message (Collapse)Author
2023-10-12tidy: modernize-use-emplaceMarcoFalke
2023-07-07wallet: bdb: include bdb header from our implementation files onlyCory Fields
This way the dependency can't sneak into other files without being noticed. Forward-declare bdb classes as necessary.
2023-07-06wallet: bdb: drop default parameterCory Fields
2023-06-19salvage: Remove use of ReadKeyValue in salvageAndrew Chow
To prepare to remove ReadKeyValue, change salvage to not use it
2023-06-01wallet: Add GetPrefixCursor to DatabaseBatchAndrew Chow
In order to get records beginning with a prefix, we will need a cursor specifically for that prefix. So add a GetPrefixCursor function and DatabaseCursor classes for dealing with those prefixes. Tested on each supported db engine. 1) Write two different key->value elements to db. 2) Create a new prefix cursor and walk-through every returned element, verifying that it gets parsed properly. 3) Try to move the cursor outside the filtered range: expect failure and flag complete=true. Co-Authored-By: Ryan Ofsky <ryan@ofsky.org> Co-Authored-By: furszy <matiasfurszyfer@protonmail.com>
2023-05-03wallet: Move DummyDatabase to salvageAndrew Chow
It's only used by salvage, so make it local to that only.
2023-03-23refactor: Move fs.* to util/fs.*TheCharlatan
The fs.* files are already part of the libbitcoin_util library. With the introduction of the fs_helpers.* it makes sense to move fs.* into the util/ directory as well.
2023-02-15refactor: wallet, remove global 'ArgsManager' accessfurszy
we are not using it anymore
2023-01-26Use DataStream where possibleMarcoFalke
2022-03-16Replace use of `ArgsManager` with `DatabaseOptions`Kiminuo
Co-authored-by: Russell Yanofsky <russ@yanofsky.org>
2022-01-06Add src/wallet/* code to wallet:: namespaceRussell Yanofsky
2021-12-30scripted-diff: Bump copyright headersHennadii Stepanov
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT- Commits of previous years: * 2020: fa0074e2d82928016a43ca408717154a1c70a4db * 2019: aaaaad6ac95b402fe18d019d67897ced6b316ee0
2021-11-09Remove `gArgs` from `wallet.h` and `wallet.cpp`Kiminuo
Co-authored-by: Russell Yanofsky <russ@yanofsky.org>
2021-09-30Remove -rescan startup parameterSamuel Dobson
2021-05-04refactor: Replace &foo[0] with foo.data()MarcoFalke
2021-03-11scripted-diff: remove MakeUnique<T>()fanquake
-BEGIN VERIFY SCRIPT- git rm src/util/memory.h sed -i -e 's/MakeUnique/std::make_unique/g' $(git grep -l MakeUnique src) sed -i -e '/#include <util\/memory.h>/d' $(git grep -l '#include <util/memory.h>' src) sed -i -e '/util\/memory.h \\/d' src/Makefile.am -END VERIFY SCRIPT-
2020-12-04refactor: Drop call to GetWalletEnv in wallet salvage codeRussell Yanofsky
No observable change in behavior. This just avoids a redundant environment lookup. Motivation is to be able to simplify the GetWalletEnv implementation in an upcoming commit.
2020-11-18Enforce salvage is only for BDB walletsAndrew Chow
2020-11-18Include wallet/bdb.h where it is actually being usedAndrew Chow
2020-09-03wallet: Remove path checking code from bitcoin-wallet toolRussell Yanofsky
This commit does not change behavior except for error messages which now include more complete information.
2020-09-03Remove WalletLocation classRussell Yanofsky
This removes a source of complexity and indirection that makes it harder to understand path checking code. Path checks will be simplified in upcoming commits. There is no change in behavior in this commit other than a slightly more descriptive error message in `loadwallet` if the default "" wallet can't be found. (The error message is improved more in upcoming commit "wallet: Remove path checking code from loadwallet RPC".)
2020-08-25wallet: filter for keys only before record deser in salvageAndrew Chow
When salvaging a wallet, avoid deserializing any records that we don't care about, i.e. filter for keys only before the deserialization.
2020-07-26wallettool: Have RecoverDatabaseFile return errors and warningsAndrew Chow
Instead of logging or printing these errors and warnings, return them to the caller.
2020-07-13walletdb: Don't remove database transaction logs and instead errorAndrew Chow
Instead of removing the database transaction logs and retrying the wallet loading, just return an error message to the user. Additionally, specifically for DB_RUNRECOVERY, notify the user that this could be due to different BDB versions. This error is pretty much only caused by compiling with a newer version of BDB and then trying to open the wallet with a version compiled with an older version of BDB.
2020-07-01walletdb: Combine VerifyDatabaseFile and VerifyEnvironmentAndrew Chow
Combine these two functions into a single Verify function that is a member of WalletDatabase. Additionally, these are no longer static.
2020-06-17scripted-diff: Replace WalletDatabase::Create* with CreateWalletDatabaseAndrew Chow
-BEGIN VERIFY SCRIPT- sed -i -e 's/WalletDatabase::Create(/CreateWalletDatabase(/g' `git grep -l "WalletDatabase::Create("` sed -i -e 's/WalletDatabase::CreateDummy(/CreateDummyWalletDatabase(/g' `git grep -l "WalletDatabase::CreateDummy("` sed -i -e 's/WalletDatabase::CreateMock(/CreateMockWalletDatabase(/g' `git grep -l "WalletDatabase::CreateMock("` -END VERIFY SCRIPT-
2020-05-25Move RecoverKeysOnlyFilter into RecoverDataBaseFileAndrew Chow
2020-05-25Move RecoverDatabaseFile and RecoverKeysOnlyFilter into salvage.{cpp/h}Andrew Chow