mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-11 21:20:39 +02:00
wallet: remove unused warnings parameter from CreateFromDump
`CreateFromDump` never writes to the vector, so the loop that prints it
in wallet-tool cannot produce output. `tool_wallet.py` already asserts
empty output for `createfromdump`.
The only `warnings.push_back()` was removed in 7a41c939f0 ("wallet:
Remove -format and bdb from wallet tool's createfromdump").
This commit is contained in:
@@ -119,7 +119,7 @@ static void WalletToolReleaseWallet(CWallet* wallet)
|
||||
delete wallet;
|
||||
}
|
||||
|
||||
bool CreateFromDump(const ArgsManager& args, const std::string& name, const fs::path& wallet_path, bilingual_str& error, std::vector<bilingual_str>& warnings)
|
||||
bool CreateFromDump(const ArgsManager& args, const std::string& name, const fs::path& wallet_path, bilingual_str& error)
|
||||
{
|
||||
if (name.empty()) {
|
||||
tfm::format(std::cerr, "Wallet name cannot be empty\n");
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include <util/fs.h>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
struct bilingual_str;
|
||||
class ArgsManager;
|
||||
@@ -17,7 +16,7 @@ namespace wallet {
|
||||
class WalletDatabase;
|
||||
|
||||
bool DumpWallet(const ArgsManager& args, WalletDatabase& db, bilingual_str& error);
|
||||
bool CreateFromDump(const ArgsManager& args, const std::string& name, const fs::path& wallet_path, bilingual_str& error, std::vector<bilingual_str>& warnings);
|
||||
bool CreateFromDump(const ArgsManager& args, const std::string& name, const fs::path& wallet_path, bilingual_str& error);
|
||||
} // namespace wallet
|
||||
|
||||
#endif // BITCOIN_WALLET_DUMP_H
|
||||
|
||||
@@ -162,11 +162,7 @@ bool ExecuteWalletToolFunc(const ArgsManager& args, const std::string& command)
|
||||
return ret;
|
||||
} else if (command == "createfromdump") {
|
||||
bilingual_str error;
|
||||
std::vector<bilingual_str> warnings;
|
||||
bool ret = CreateFromDump(args, name, path, error, warnings);
|
||||
for (const auto& warning : warnings) {
|
||||
tfm::format(std::cout, "%s\n", warning.original);
|
||||
}
|
||||
bool ret = CreateFromDump(args, name, path, error);
|
||||
if (!ret && !error.empty()) {
|
||||
tfm::format(std::cerr, "%s\n", error.original);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user