kernel: make blockTip index const
Notification interface subscribers need to view, but not mutate, the index.
This commit is contained in:
4 files changed
+4
-4
No files matched your search
@@ -74,7 +74,7 @@ int main(int argc, char* argv[])
|
|||||||
class KernelNotifications : public kernel::Notifications
|
class KernelNotifications : public kernel::Notifications
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
kernel::InterruptResult blockTip(SynchronizationState, CBlockIndex&, double) override
|
kernel::InterruptResult blockTip(SynchronizationState, const CBlockIndex&, double) override
|
||||||
{
|
{
|
||||||
std::cout << "Block tip changed" << std::endl;
|
std::cout << "Block tip changed" << std::endl;
|
||||||
return {};
|
return {};
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class Notifications
|
|||||||
public:
|
public:
|
||||||
virtual ~Notifications() = default;
|
virtual ~Notifications() = default;
|
||||||
|
|
||||||
[[nodiscard]] virtual InterruptResult blockTip(SynchronizationState state, CBlockIndex& index, double verification_progress) { return {}; }
|
[[nodiscard]] virtual InterruptResult blockTip(SynchronizationState state, const CBlockIndex& index, double verification_progress) { return {}; }
|
||||||
virtual void headerTip(SynchronizationState state, int64_t height, int64_t timestamp, bool presync) {}
|
virtual void headerTip(SynchronizationState state, int64_t height, int64_t timestamp, bool presync) {}
|
||||||
virtual void progress(const bilingual_str& title, int progress_percent, bool resume_possible) {}
|
virtual void progress(const bilingual_str& title, int progress_percent, bool resume_possible) {}
|
||||||
virtual void warningSet(Warning id, const bilingual_str& message) {}
|
virtual void warningSet(Warning id, const bilingual_str& message) {}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ static void AlertNotify(const std::string& strMessage)
|
|||||||
|
|
||||||
namespace node {
|
namespace node {
|
||||||
|
|
||||||
kernel::InterruptResult KernelNotifications::blockTip(SynchronizationState state, CBlockIndex& index, double verification_progress)
|
kernel::InterruptResult KernelNotifications::blockTip(SynchronizationState state, const CBlockIndex& index, double verification_progress)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
LOCK(m_tip_block_mutex);
|
LOCK(m_tip_block_mutex);
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public:
|
|||||||
KernelNotifications(const std::function<bool()>& shutdown_request, std::atomic<int>& exit_status, node::Warnings& warnings)
|
KernelNotifications(const std::function<bool()>& shutdown_request, std::atomic<int>& exit_status, node::Warnings& warnings)
|
||||||
: m_shutdown_request(shutdown_request), m_exit_status{exit_status}, m_warnings{warnings} {}
|
: m_shutdown_request(shutdown_request), m_exit_status{exit_status}, m_warnings{warnings} {}
|
||||||
|
|
||||||
[[nodiscard]] kernel::InterruptResult blockTip(SynchronizationState state, CBlockIndex& index, double verification_progress) override EXCLUSIVE_LOCKS_REQUIRED(!m_tip_block_mutex);
|
[[nodiscard]] kernel::InterruptResult blockTip(SynchronizationState state, const CBlockIndex& index, double verification_progress) override EXCLUSIVE_LOCKS_REQUIRED(!m_tip_block_mutex);
|
||||||
|
|
||||||
void headerTip(SynchronizationState state, int64_t height, int64_t timestamp, bool presync) override;
|
void headerTip(SynchronizationState state, int64_t height, int64_t timestamp, bool presync) override;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user