From 19d888ce407f44d90785c456a1a3e2a6870e9245 Mon Sep 17 00:00:00 2001 From: Jon Atack Date: Wed, 29 Mar 2023 09:31:14 -0700 Subject: [PATCH] rpc: move WALLET_FLAG_CAVEATS to the compilation unit of its caller and add the walletutil.h include header for WALLET_FLAG_AVOID_REUSE that was already missing before this change. WALLET_FLAG_CAVEATS is only used in one RPC, so no need to encumber wallet.h and wallet.cpp with it, along with all of the files that include wallet.h during their compilation. Also apply clang-format per: git diff -U0 HEAD~1.. | ./contrib/devtools/clang-format-diff.py -p1 -i -v --- src/wallet/rpc/wallet.cpp | 9 +++++++++ src/wallet/wallet.cpp | 7 ------- src/wallet/wallet.h | 2 -- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/wallet/rpc/wallet.cpp b/src/wallet/rpc/wallet.cpp index d4aff4dfd63..ea3507bc751 100644 --- a/src/wallet/rpc/wallet.cpp +++ b/src/wallet/rpc/wallet.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include @@ -20,6 +21,14 @@ namespace wallet { + +static const std::map WALLET_FLAG_CAVEATS{ + {WALLET_FLAG_AVOID_REUSE, + "You need to rescan the blockchain in order to correctly mark used " + "destinations in the past. Until this is done, some destinations may " + "be considered unused, even if the opposite is the case."}, +}; + /** Checks if a CKey is in the given CWallet compressed or otherwise*/ bool HaveKey(const SigningProvider& wallet, const CKey& key) { diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index ef8fb29e649..2b8aeacb2ef 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -51,13 +51,6 @@ using interfaces::FoundBlock; namespace wallet { -const std::map WALLET_FLAG_CAVEATS{ - {WALLET_FLAG_AVOID_REUSE, - "You need to rescan the blockchain in order to correctly mark used " - "destinations in the past. Until this is done, some destinations may " - "be considered unused, even if the opposite is the case." - }, -}; bool AddWalletSetting(interfaces::Chain& chain, const std::string& wallet_name) { diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index e8c18dbb675..346b63fd869 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -145,8 +145,6 @@ static const std::map WALLET_FLAG_MAP{ {"external_signer", WALLET_FLAG_EXTERNAL_SIGNER} }; -extern const std::map WALLET_FLAG_CAVEATS; - /** A wrapper to reserve an address from a wallet * * ReserveDestination is used to reserve an address.