aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/interfaces/chain.cpp1
-rw-r--r--src/interfaces/chain.h3
-rw-r--r--src/wallet/rpcwallet.cpp2
3 files changed, 5 insertions, 1 deletions
diff --git a/src/interfaces/chain.cpp b/src/interfaces/chain.cpp
index 725b485e51..fb634e73da 100644
--- a/src/interfaces/chain.cpp
+++ b/src/interfaces/chain.cpp
@@ -248,6 +248,7 @@ public:
CAmount maxTxFee() override { return ::maxTxFee; }
bool getPruneMode() override { return ::fPruneMode; }
bool p2pEnabled() override { return g_connman != nullptr; }
+ bool isInitialBlockDownload() override { return IsInitialBlockDownload(); }
int64_t getAdjustedTime() override { return GetAdjustedTime(); }
void initMessage(const std::string& message) override { ::uiInterface.InitMessage(message); }
void initWarning(const std::string& message) override { InitWarning(message); }
diff --git a/src/interfaces/chain.h b/src/interfaces/chain.h
index 116656fef4..60f8570e36 100644
--- a/src/interfaces/chain.h
+++ b/src/interfaces/chain.h
@@ -178,6 +178,9 @@ public:
//! Check if p2p enabled.
virtual bool p2pEnabled() = 0;
+ // Check if in IBD.
+ virtual bool isInitialBlockDownload() = 0;
+
//! Get adjusted time.
virtual int64_t getAdjustedTime() = 0;
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp
index 8d1bd3a169..a30df9f037 100644
--- a/src/wallet/rpcwallet.cpp
+++ b/src/wallet/rpcwallet.cpp
@@ -3889,7 +3889,7 @@ UniValue sethdseed(const JSONRPCRequest& request)
}.ToString());
}
- if (IsInitialBlockDownload()) {
+ if (pwallet->chain().isInitialBlockDownload()) {
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Cannot set a new HD seed while still in Initial Block Download");
}