File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -289,6 +289,9 @@ class Chain
289289 // ! Check if any block has been pruned.
290290 virtual bool havePruned () = 0;
291291
292+ // ! Get the current prune height.
293+ virtual std::optional<int > getPruneHeight () = 0;
294+
292295 // ! Check if the node is ready to broadcast transactions.
293296 virtual bool isReadyToBroadcast () = 0;
294297
Original file line number Diff line number Diff line change 4646#include < policy/settings.h>
4747#include < primitives/block.h>
4848#include < primitives/transaction.h>
49+ #include < rpc/blockchain.h>
4950#include < rpc/protocol.h>
5051#include < rpc/server.h>
5152#include < support/allocators/secure.h>
@@ -770,6 +771,11 @@ class ChainImpl : public Chain
770771 LOCK (::cs_main);
771772 return chainman ().m_blockman .m_have_pruned ;
772773 }
774+ std::optional<int > getPruneHeight () override
775+ {
776+ LOCK (chainman ().GetMutex ());
777+ return GetPruneHeight (chainman ().m_blockman , chainman ().ActiveChain ());
778+ }
773779 bool isReadyToBroadcast () override { return !chainman ().m_blockman .LoadingBlocks () && !isInitialBlockDownload (); }
774780 bool isInitialBlockDownload () override
775781 {
You can’t perform that action at this time.
0 commit comments