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
289
289
// ! Check if any block has been pruned.
290
290
virtual bool havePruned () = 0;
291
291
292
+ // ! Get the current prune height.
293
+ virtual std::optional<int > getPruneHeight () = 0;
294
+
292
295
// ! Check if the node is ready to broadcast transactions.
293
296
virtual bool isReadyToBroadcast () = 0;
294
297
Original file line number Diff line number Diff line change 46
46
#include < policy/settings.h>
47
47
#include < primitives/block.h>
48
48
#include < primitives/transaction.h>
49
+ #include < rpc/blockchain.h>
49
50
#include < rpc/protocol.h>
50
51
#include < rpc/server.h>
51
52
#include < support/allocators/secure.h>
@@ -770,6 +771,11 @@ class ChainImpl : public Chain
770
771
LOCK (::cs_main);
771
772
return chainman ().m_blockman .m_have_pruned ;
772
773
}
774
+ std::optional<int > getPruneHeight () override
775
+ {
776
+ LOCK (chainman ().GetMutex ());
777
+ return GetPruneHeight (chainman ().m_blockman , chainman ().ActiveChain ());
778
+ }
773
779
bool isReadyToBroadcast () override { return !chainman ().m_blockman .LoadingBlocks () && !isInitialBlockDownload (); }
774
780
bool isInitialBlockDownload () override
775
781
{
You can’t perform that action at this time.
0 commit comments