@@ -52,6 +52,9 @@ class Mempool;
5252namespace rpc { struct WorkData ; }
5353} // namespace btc::coin
5454
55+ // Merged-mining manager (embedded NMC etc.) — heavy header lives in the .cpp.
56+ namespace c2pool { namespace merged { class MergedMiningManager ; } }
57+
5558namespace btc ::stratum {
5659
5760class BTCWorkSource : public core ::stratum::IWorkSource
@@ -227,6 +230,11 @@ class BTCWorkSource : public core::stratum::IWorkSource
227230 // / a stratum proxy without sharechain participation.
228231 void set_create_share_fn (CreateShareFn fn);
229232
233+ // / Wire the merged-mining manager (embedded NMC etc.). Called once at
234+ // / startup from main_btc.cpp when --merged is passed. null => no
235+ // / merged chains, has_merged_chain() returns false.
236+ void set_merged_mining_manager (c2pool::merged::MergedMiningManager* mm) { mm_manager_ = mm; }
237+
230238 // / Set the donation script (bytes of the c2pool donation
231239 // / scriptPubKey — typically a P2PKH or P2WPKH for the c2pool donation
232240 // / address). Used by build_connection_coinbase as the residual
@@ -268,6 +276,10 @@ class BTCWorkSource : public core::stratum::IWorkSource
268276 CreateShareFn create_share_fn_;
269277 std::vector<unsigned char > donation_script_;
270278
279+ // Merged-mining manager (embedded NMC etc.); non-owning, set by
280+ // main_btc.cpp. null => no merged chains configured.
281+ c2pool::merged::MergedMiningManager* mm_manager_ = nullptr ;
282+
271283 // Template cache (filled lazily; invalidated when work_generation_ bumps)
272284 // Stage 4c populates these.
273285 mutable std::mutex template_mutex_;
0 commit comments