File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -139,6 +139,8 @@ void UnregisterSharedValidationInterface(std::shared_ptr<CValidationInterface> c
139139
140140void UnregisterValidationInterface (CValidationInterface* callbacks)
141141{
142+ callbacks->ValidationInterfaceUnregistering ();
143+
142144 if (g_signals.m_internals ) {
143145 g_signals.m_internals ->Unregister (callbacks);
144146 }
@@ -149,6 +151,9 @@ void UnregisterAllValidationInterfaces()
149151 if (!g_signals.m_internals ) {
150152 return ;
151153 }
154+
155+ g_signals.m_internals ->Iterate ([&](CValidationInterface& callbacks) { callbacks.ValidationInterfaceUnregistering (); });
156+
152157 g_signals.m_internals ->Clear ();
153158}
154159
Original file line number Diff line number Diff line change @@ -173,6 +173,13 @@ class CValidationInterface {
173173 * Notifies listeners that a block which builds directly on our current tip
174174 * has been received and connected to the headers tree, though not validated yet */
175175 virtual void NewPoWValidBlock (const CBlockIndex *pindex, const std::shared_ptr<const CBlock>& block) {};
176+ /* *
177+ * Notifies the validation interface that it is being unregistered
178+ */
179+ virtual void ValidationInterfaceUnregistering () {};
180+
181+ friend void UnregisterValidationInterface (CValidationInterface*);
182+ friend void UnregisterAllValidationInterfaces ();
176183 friend class CMainSignals ;
177184};
178185
You can’t perform that action at this time.
0 commit comments