From 4c8fe044d3241664151b3727e31ac2eaa741b717 Mon Sep 17 00:00:00 2001 From: Ryan Ofsky Date: Wed, 26 Jun 2024 22:18:07 -0400 Subject: [PATCH] wallet, logging: Switch LogInfo to LogError in AddWalletDescriptor Seems like all of these cases are treated as errors, so it makes sense to use the corresponding log level. Change suggested by hodlinator in https://github.com/bitcoin/bitcoin/pull/30343#discussion_r1655434943 --- src/wallet/wallet.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 7e241f8873324..eced286aa4f16 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3923,13 +3923,13 @@ ScriptPubKeyMan* CWallet::AddWalletDescriptor(WalletDescriptor& desc, const Flat AssertLockHeld(cs_wallet); if (!IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS)) { - LogInfo(m_log, "Cannot add WalletDescriptor to a non-descriptor wallet\n"); + LogError(m_log, "Cannot add WalletDescriptor to a non-descriptor wallet\n"); return nullptr; } auto spk_man = GetDescriptorScriptPubKeyMan(desc); if (spk_man) { - LogInfo(m_log, "Update existing descriptor: %s\n", desc.descriptor->ToString()); + LogError(m_log, "Update existing descriptor: %s\n", desc.descriptor->ToString()); spk_man->UpdateWalletDescriptor(desc); } else { auto new_spk_man = std::unique_ptr(new DescriptorScriptPubKeyMan(*this, desc, m_keypool_size)); @@ -3948,7 +3948,7 @@ ScriptPubKeyMan* CWallet::AddWalletDescriptor(WalletDescriptor& desc, const Flat // Top up key pool, the manager will generate new scriptPubKeys internally if (!spk_man->TopUp()) { - LogInfo(m_log, "Could not top up scriptPubKeys\n"); + LogError(m_log, "Could not top up scriptPubKeys\n"); return nullptr; } @@ -3957,7 +3957,7 @@ ScriptPubKeyMan* CWallet::AddWalletDescriptor(WalletDescriptor& desc, const Flat if (!desc.descriptor->IsRange()) { auto script_pub_keys = spk_man->GetScriptPubKeys(); if (script_pub_keys.empty()) { - LogInfo(m_log, "Could not generate scriptPubKeys (cache is empty)\n"); + LogError(m_log, "Could not generate scriptPubKeys (cache is empty)\n"); return nullptr; }