From a1df1b48a80bf122efa73677ff72577ec0103a3b Mon Sep 17 00:00:00 2001 From: Russell Yanofsky Date: Tue, 10 Jul 2018 15:48:03 -0400 Subject: [PATCH] Remove use of IsInitialBlockDownload in wallet code This commit does not change behavior. --- src/interfaces/chain.cpp | 1 + src/interfaces/chain.h | 3 +++ src/wallet/rpcwallet.cpp | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/interfaces/chain.cpp b/src/interfaces/chain.cpp index 725b485e5..fb634e73d 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 116656fef..60f8570e3 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 8d1bd3a16..a30df9f03 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"); }