Skip to content

Commit 56f959d

Browse files
committed
wallet: Remove wallettool salvage
Salvage is bdb only which is about to be removed.
1 parent 7a41c93 commit 56f959d

File tree

5 files changed

+1
-261
lines changed

5 files changed

+1
-261
lines changed

src/bitcoin-wallet.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ static void SetupWalletToolArgs(ArgsManager& argsman)
4545

4646
argsman.AddCommand("info", "Get wallet info");
4747
argsman.AddCommand("create", "Create new wallet file");
48-
argsman.AddCommand("salvage", "Attempt to recover private keys from a corrupt wallet. Warning: 'salvage' is experimental.");
4948
argsman.AddCommand("dump", "Print out all of the wallet key-value records");
5049
argsman.AddCommand("createfromdump", "Create new wallet file from dumped records");
5150
}

src/wallet/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ target_link_libraries(bitcoin_wallet
4646
)
4747

4848
if(USE_BDB)
49-
target_sources(bitcoin_wallet PRIVATE bdb.cpp salvage.cpp)
49+
target_sources(bitcoin_wallet PRIVATE bdb.cpp)
5050
target_link_libraries(bitcoin_wallet PUBLIC BerkeleyDB::BerkeleyDB)
5151
endif()

src/wallet/salvage.cpp

Lines changed: 0 additions & 221 deletions
This file was deleted.

src/wallet/salvage.h

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/wallet/wallettool.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include <util/fs.h>
1111
#include <util/translation.h>
1212
#include <wallet/dump.h>
13-
#include <wallet/salvage.h>
1413
#include <wallet/wallet.h>
1514
#include <wallet/walletutil.h>
1615

@@ -165,24 +164,6 @@ bool ExecuteWalletToolFunc(const ArgsManager& args, const std::string& command)
165164
if (!wallet_instance) return false;
166165
WalletShowInfo(wallet_instance.get());
167166
wallet_instance->Close();
168-
} else if (command == "salvage") {
169-
#ifdef USE_BDB
170-
bilingual_str error;
171-
std::vector<bilingual_str> warnings;
172-
bool ret = RecoverDatabaseFile(args, path, error, warnings);
173-
if (!ret) {
174-
for (const auto& warning : warnings) {
175-
tfm::format(std::cerr, "%s\n", warning.original);
176-
}
177-
if (!error.empty()) {
178-
tfm::format(std::cerr, "%s\n", error.original);
179-
}
180-
}
181-
return ret;
182-
#else
183-
tfm::format(std::cerr, "Salvage command is not available as BDB support is not compiled");
184-
return false;
185-
#endif
186167
} else if (command == "dump") {
187168
DatabaseOptions options;
188169
ReadDatabaseArgs(args, options);

0 commit comments

Comments
 (0)