@@ -325,6 +325,15 @@ void PrepareShutdown(NodeContext& node)
325325 g_active_notification_interface.reset ();
326326 }
327327
328+ if (node.cj_ctx ) {
329+ UnregisterValidationInterface (node.cj_ctx .get ());
330+ }
331+
332+ if (g_ds_notification_interface) {
333+ UnregisterValidationInterface (g_ds_notification_interface.get ());
334+ g_ds_notification_interface.reset ();
335+ }
336+
328337 // After all scheduled tasks have been flushed, destroy pointers
329338 // and reset all to nullptr.
330339 node.active_ctx .reset ();
@@ -376,11 +385,6 @@ void PrepareShutdown(NodeContext& node)
376385 }
377386#endif
378387
379- if (g_ds_notification_interface) {
380- UnregisterValidationInterface (g_ds_notification_interface.get ());
381- g_ds_notification_interface.reset ();
382- }
383-
384388 node.mn_activeman .reset ();
385389
386390 node.chain_clients .clear ();
@@ -2136,6 +2140,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
21362140 node.cj_ctx = std::make_unique<CJContext>(chainman, *node.dmnman , *node.mn_metaman , *node.mempool ,
21372141 node.mn_activeman .get (), *node.mn_sync , *node.llmq_ctx ->isman ,
21382142 !ignores_incoming_txs);
2143+ RegisterValidationInterface (node.cj_ctx .get ());
21392144
21402145 assert (!node.peerman );
21412146 node.peerman = PeerManager::make (chainparams, *node.connman , *node.addrman , node.banman .get (), *node.dstxman ,
@@ -2145,7 +2150,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
21452150 RegisterValidationInterface (node.peerman .get ());
21462151
21472152 g_ds_notification_interface = std::make_unique<CDSNotificationInterface>(
2148- *node.connman , *node.dstxman , *node.mn_sync , *node.govman , chainman, node.dmnman , node.llmq_ctx , node. cj_ctx
2153+ *node.connman , *node.dstxman , *node.mn_sync , *node.govman , chainman, node.dmnman , node.llmq_ctx
21492154 );
21502155 RegisterValidationInterface (g_ds_notification_interface.get ());
21512156
0 commit comments