refactor: Enforce C-str fmt strings in WalletLogPrintf()

This commit is contained in:
MarcoFalke
2023-08-08 09:30:51 +02:00
parent fa244f3321
commit fa6dc57760
5 changed files with 15 additions and 13 deletions

View File

@@ -249,9 +249,10 @@ public:
virtual std::unordered_set<CScript, SaltedSipHasher> GetScriptPubKeys() const { return {}; };
/** Prepends the wallet name in logging output to ease debugging in multi-wallet use cases */
template<typename... Params>
void WalletLogPrintf(std::string fmt, Params... parameters) const {
LogPrintf(("%s " + fmt).c_str(), m_storage.GetDisplayName(), parameters...);
template <typename... Params>
void WalletLogPrintf(const char* fmt, Params... parameters) const
{
LogPrintf(("%s " + std::string{fmt}).c_str(), m_storage.GetDisplayName(), parameters...);
};
/** Watch-only address added */