diff options
author | Andrew Chow <achow101-github@achow101.com> | 2020-07-06 14:34:49 -0400 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2020-07-26 20:22:45 -0400 |
commit | 9f536d4fe949666f14a0bf5b814522cecde71f56 (patch) | |
tree | 8e9ad411b07c37a653ce4db46bad9df976a975fa /src/wallet/wallettool.cpp | |
parent | 06e263a4e368671ebb4e4a77c1447ebd5104a488 (diff) |
wallettool: Have RecoverDatabaseFile return errors and warnings
Instead of logging or printing these errors and warnings, return them to
the caller.
Diffstat (limited to 'src/wallet/wallettool.cpp')
-rw-r--r-- | src/wallet/wallettool.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/wallet/wallettool.cpp b/src/wallet/wallettool.cpp index 1e699658e4..5cabefcbfc 100644 --- a/src/wallet/wallettool.cpp +++ b/src/wallet/wallettool.cpp @@ -126,7 +126,18 @@ bool ExecuteWalletToolFunc(const std::string& command, const std::string& name) WalletShowInfo(wallet_instance.get()); wallet_instance->Flush(true); } else if (command == "salvage") { - return RecoverDatabaseFile(path); + bilingual_str error; + std::vector<bilingual_str> warnings; + bool ret = RecoverDatabaseFile(path, error, warnings); + if (!ret) { + for (const auto warning : warnings) { + tfm::format(std::cerr, "%s\n", warning.original); + } + if (!error.empty()) { + tfm::format(std::cerr, "%s\n", error.original); + } + } + return ret; } } else { tfm::format(std::cerr, "Invalid command: %s\n", command); |