aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2023-03-29 09:31:14 -0700
committerJon Atack <jon@atack.com>2023-04-10 10:41:56 -0700
commit19d888ce407f44d90785c456a1a3e2a6870e9245 (patch)
tree2c27b551dddeb0b26d7b3bd5fdfe083b6a405d04 /src
parent01df011ca2bf46ee4c988b03a130eea6df692325 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/wallet/rpc/wallet.cpp9
-rw-r--r--src/wallet/wallet.cpp7
-rw-r--r--src/wallet/wallet.h2
3 files changed, 9 insertions, 9 deletions
diff --git a/src/wallet/rpc/wallet.cpp b/src/wallet/rpc/wallet.cpp
index d4aff4dfd6..ea3507bc75 100644
--- a/src/wallet/rpc/wallet.cpp
+++ b/src/wallet/rpc/wallet.cpp
@@ -13,6 +13,7 @@
#include <wallet/rpc/wallet.h>
#include <wallet/rpc/util.h>
#include <wallet/wallet.h>
+#include <wallet/walletutil.h>
#include <optional>
@@ -20,6 +21,14 @@
namespace wallet {
+
+static const std::map<uint64_t, std::string> 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 ef8fb29e64..2b8aeacb2e 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -51,13 +51,6 @@
using interfaces::FoundBlock;
namespace wallet {
-const std::map<uint64_t,std::string> 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 e8c18dbb67..346b63fd86 100644
--- a/src/wallet/wallet.h
+++ b/src/wallet/wallet.h
@@ -145,8 +145,6 @@ static const std::map<std::string,WalletFlags> WALLET_FLAG_MAP{
{"external_signer", WALLET_FLAG_EXTERNAL_SIGNER}
};
-extern const std::map<uint64_t,std::string> WALLET_FLAG_CAVEATS;
-
/** A wrapper to reserve an address from a wallet
*
* ReserveDestination is used to reserve an address.