File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,9 @@ class Mining
3030 // ! If this chain is exclusively used for testing
3131 virtual bool isTestChain () = 0;
3232
33+ // ! Returns whether IBD is still in progress.
34+ virtual bool isInitialBlockDownload () = 0;
35+
3336 // ! Returns the hash for the tip of this chain
3437 virtual std::optional<uint256> getTipHash () = 0;
3538
Original file line number Diff line number Diff line change @@ -847,6 +847,11 @@ class MinerImpl : public Mining
847847 return chainman ().GetParams ().IsTestChain ();
848848 }
849849
850+ bool isInitialBlockDownload () override
851+ {
852+ return chainman ().IsInitialBlockDownload ();
853+ }
854+
850855 std::optional<uint256> getTipHash () override
851856 {
852857 LOCK (::cs_main);
Original file line number Diff line number Diff line change @@ -735,7 +735,7 @@ static RPCHelpMan getblocktemplate()
735735 throw JSONRPCError (RPC_CLIENT_NOT_CONNECTED, PACKAGE_NAME " is not connected!" );
736736 }
737737
738- if (chainman. IsInitialBlockDownload ()) {
738+ if (miner. isInitialBlockDownload ()) {
739739 throw JSONRPCError (RPC_CLIENT_IN_INITIAL_DOWNLOAD, PACKAGE_NAME " is in initial sync and waiting for blocks..." );
740740 }
741741 }
You can’t perform that action at this time.
0 commit comments