Merge bitcoin/bitcoin#23147: refactor: rename DBErrors::RESCAN_REQUIRED to NEED_RESCAN

8615507a4e scripted-diff: rename DBErrors::RESCAN_REQUIRED to NEED_RESCAN (Samuel Dobson)

Pull request description:

  Suggested here as a trivial follow-up: https://github.com/bitcoin/bitcoin/pull/23123#discussion_r719709924

  Makes RESCAN_REQUIRED consistent with NEED_REWRITE

ACKs for top commit:
  achow101:
    ACK 8615507a4e
  jonatack:
    ACK 8615507a4e

Tree-SHA512: 82d057c45e192cd6dd8a47675b52699e6cbc82272609a971e6e5d6796aad14a941a70e40d3913dbb611f79c8eadff8030c60ea6f203f2edc3720c0e78c166b97
This commit is contained in:
fanquake 2021-10-01 10:39:47 +08:00
commit 33b0696d31
No known key found for this signature in database
GPG key ID: 2EEB9F5CC09526C1
4 changed files with 4 additions and 4 deletions

View file

@ -2560,7 +2560,7 @@ std::shared_ptr<CWallet> CWallet::Create(WalletContext& context, const std::stri
{
error = strprintf(_("Wallet needed to be rewritten: restart %s to complete"), PACKAGE_NAME);
return nullptr;
} else if (nLoadWalletRet == DBErrors::RESCAN_REQUIRED) {
} else if (nLoadWalletRet == DBErrors::NEED_RESCAN) {
warnings.push_back(strprintf(_("Error reading %s! Transaction data may be missing or incorrect."
" Rescanning wallet."), walletFile));
rescan_required = true;

View file

@ -861,7 +861,7 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet)
}
if (rescan_required && result == DBErrors::LOAD_OK) {
result = DBErrors::RESCAN_REQUIRED;
result = DBErrors::NEED_RESCAN;
} else if (fNoncriticalErrors && result == DBErrors::LOAD_OK) {
result = DBErrors::NONCRITICAL_ERROR;
}

View file

@ -49,7 +49,7 @@ enum class DBErrors
TOO_NEW,
LOAD_FAIL,
NEED_REWRITE,
RESCAN_REQUIRED
NEED_RESCAN
};
namespace DBKeys {

View file

@ -76,7 +76,7 @@ static std::shared_ptr<CWallet> MakeWallet(const std::string& name, const fs::pa
} else if (load_wallet_ret == DBErrors::NEED_REWRITE) {
tfm::format(std::cerr, "Wallet needed to be rewritten: restart %s to complete", PACKAGE_NAME);
return nullptr;
} else if (load_wallet_ret == DBErrors::RESCAN_REQUIRED) {
} else if (load_wallet_ret == DBErrors::NEED_RESCAN) {
tfm::format(std::cerr, "Error reading %s! Some transaction data might be missing or"
" incorrect. Wallet requires a rescan.",
name);