From 93db74a91ed7416754899d4cbacf213647894871 Mon Sep 17 00:00:00 2001 From: selsta Date: Sat, 20 Aug 2022 00:40:46 +0200 Subject: rpc: skip bootstrap nodes that are lower than last checkpoint --- src/cryptonote_core/blockchain.h | 7 +++++++ src/cryptonote_core/cryptonote_core.cpp | 4 ++++ src/cryptonote_core/cryptonote_core.h | 7 +++++++ 3 files changed, 18 insertions(+) (limited to 'src/cryptonote_core') diff --git a/src/cryptonote_core/blockchain.h b/src/cryptonote_core/blockchain.h index 7a94f6358..355d0de1a 100644 --- a/src/cryptonote_core/blockchain.h +++ b/src/cryptonote_core/blockchain.h @@ -158,6 +158,13 @@ namespace cryptonote */ bool deinit(); + /** + * @brief get a set of blockchain checkpoint hashes + * + * @return set of blockchain checkpoint hashes + */ + const checkpoints& get_checkpoints() const { return m_checkpoints; } + /** * @brief assign a set of blockchain checkpoint hashes * diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp index 95cd1c83b..31e4e0414 100644 --- a/src/cryptonote_core/cryptonote_core.cpp +++ b/src/cryptonote_core/cryptonote_core.cpp @@ -252,6 +252,10 @@ namespace cryptonote m_pprotocol = &m_protocol_stub; } //----------------------------------------------------------------------------------- + const checkpoints& core::get_checkpoints() const + { + return m_blockchain_storage.get_checkpoints(); + } void core::set_checkpoints(checkpoints&& chk_pts) { m_blockchain_storage.set_checkpoints(std::move(chk_pts)); diff --git a/src/cryptonote_core/cryptonote_core.h b/src/cryptonote_core/cryptonote_core.h index 5f134a999..6dc513570 100644 --- a/src/cryptonote_core/cryptonote_core.h +++ b/src/cryptonote_core/cryptonote_core.h @@ -436,6 +436,13 @@ namespace cryptonote */ void set_cryptonote_protocol(i_cryptonote_protocol* pprotocol); + /** + * @copydoc Blockchain::get_checkpoints + * + * @note see Blockchain::get_checkpoints() + */ + const checkpoints& get_checkpoints() const; + /** * @copydoc Blockchain::set_checkpoints * -- cgit v1.2.3