-
Notifications
You must be signed in to change notification settings - Fork 1.2k
refactor: move CDSNotificationInterface into NodeContext #7546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,13 +11,12 @@ | |
| #include <governance/governance.h> | ||
| #include <instantsend/instantsend.h> | ||
| #include <masternode/sync.h> | ||
| #include <util/check.h> | ||
| #include <validation.h> | ||
|
|
||
|
|
||
| CDSNotificationInterface::CDSNotificationInterface(CConnman& connman, CDSTXManager& dstxman, CMasternodeSync& mn_sync, | ||
| CGovernanceManager& govman, const ChainstateManager& chainman, | ||
| const std::unique_ptr<CDeterministicMNManager>& dmnman) : | ||
| CDeterministicMNManager& dmnman) : | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't understand since when / how this is safe; so I asked:
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @PastaPastaPasta this checks out, Change should be safe.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. strange, I miss this unique_ptr during #7314 - had seen it but haven't noticed as it's ready. now it should be safe indeed ; long time before 7314. |
||
| m_connman{connman}, | ||
| m_dstxman{dstxman}, | ||
| m_mn_sync{mn_sync}, | ||
|
|
@@ -50,7 +49,7 @@ void CDSNotificationInterface::SynchronousUpdatedBlockTip(const CBlockIndex *pin | |
| if (pindexNew == pindexFork) // blocks were disconnected without any new ones | ||
| return; | ||
|
|
||
| Assert(m_dmnman)->UpdatedBlockTip(pindexNew); | ||
| m_dmnman.UpdatedBlockTip(pindexNew); | ||
| } | ||
|
|
||
| void CDSNotificationInterface::UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) | ||
|
|
@@ -103,5 +102,3 @@ void CDSNotificationInterface::NotifyChainLock(const CBlockIndex* pindex, | |
| m_dstxman.NotifyChainLock(pindex); | ||
| } | ||
| } | ||
|
|
||
| std::unique_ptr<CDSNotificationInterface> g_ds_notification_interface; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,7 @@ class AddrMan; | |
| class CBlockPolicyEstimator; | ||
| class CConnman; | ||
| class CDeterministicMNManager; | ||
| class CDSNotificationInterface; | ||
| class CDSTXManager; | ||
| class CChainstateHelper; | ||
| class ChainstateManager; | ||
|
|
@@ -106,6 +107,7 @@ struct NodeContext { | |
| std::unique_ptr<chainlock::Chainlocks> chainlocks; | ||
| std::unique_ptr<chainlock::ChainlockHandler> clhandler; | ||
| //! Dash contexts | ||
| std::unique_ptr<CDSNotificationInterface> ds_notification_interface; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure about this change, upstream opted to keep their notification interface out of
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kwvg Right that upstream keeps But I'd argue zmq is upstream's outlier rather than its policy. In v31.1, The reason zmq works fine as a global is that it's self-contained: built from args alone ( 🤖 Posted autonomously by Claude on behalf of pasta.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: technically, it's not context, I think. Should be +std::unique_ptr<CDSNotificationInterface> ds_notification_interface;
//! Dash contexts
-std::unique_ptr<CDSNotificationInterface> ds_notification_interface; |
||
| std::unique_ptr<ActiveContext> active_ctx; | ||
| std::unique_ptr<LLMQContext> llmq_ctx; | ||
| std::unique_ptr<llmq::ObserverContext> observer_ctx; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: unrelated change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think not; I think it's related to the remove of Assert down below now that it's not a pointer