Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
3bed4a9
BTC Phase B0: scaffold src/impl/btc/ from LTC template
frstrtr Apr 28, 2026
03eeedb
BTC Phase B1: constants + PoW swap (scrypt -> SHA256d, jtoomim/SPB v3…
frstrtr Apr 28, 2026
5fd2331
BTC Phase B2 (offline portion): BTC genesis + DAA + log-prefix sweep
frstrtr Apr 28, 2026
7d7702b
BTC Phase B3.4: BTC subsidy 50/210000 + cleanup misleading LTC comments
frstrtr Apr 28, 2026
d3521af
BTC Phase B3-protocol: getdata MSG_WITNESS_BLOCK (BIP 144) — fix bitc…
frstrtr Apr 28, 2026
256f2e3
BTC Phase B2-net: real main_btc.cpp entry point — header-sync wiring
frstrtr Apr 28, 2026
5052055
BTC Phase B2-net++: header-sync driver + 2 consensus-critical DAA/ini…
frstrtr Apr 29, 2026
7d4a2cf
BTC Phase B2-utxo: wire UTXOViewCache + UTXOViewDB into c2pool-btc
frstrtr Apr 29, 2026
d9c0f16
BTC Phase B3-mweb-strip: remove dormant MWEB code from BTC types
frstrtr Apr 29, 2026
886ef9c
BTC Phase B4-scaffold: --p2pool flag + identity log
frstrtr Apr 29, 2026
567eec0
BTC Phase B4-net: instantiate sharechain peer (NodeBridge + listener)
frstrtr Apr 29, 2026
4028b55
BTC: --p2pool now actually exclusive — reset addrs.json on use
frstrtr Apr 29, 2026
5c1e223
BTC Phase B6: template parity smoke test (subsidy + merkle + DAA)
frstrtr Apr 29, 2026
ac452dd
BTC Phase B5: P2P submit + roundtrip tracking infrastructure
frstrtr May 1, 2026
f4e766f
core: hoist stratum boundary types to core/stratum_types.hpp
frstrtr May 1, 2026
f8f6f19
core: web_server.hpp uses core::stratum:: types via using aliases
frstrtr May 1, 2026
b911af8
core: define core::stratum::IWorkSource pure virtual interface
frstrtr May 1, 2026
6e7def5
core: MiningInterface : public IWorkSource (15 methods + 2 atomics)
frstrtr May 1, 2026
86d176d
core: stratum_server holds IWorkSource* (decoupling complete)
frstrtr May 1, 2026
541c735
BTC Phase B7-stratum 4a: BTCWorkSource skeleton
frstrtr May 1, 2026
9bd0a51
BTC Phase B7-stratum 4b/4c-i/4c-ii: prevhash + template + merkle bran…
frstrtr May 1, 2026
2dda289
BTC Phase B7-stratum 4c-iii + 4d: coinbase builder + mining_submit
frstrtr May 1, 2026
cf50e6a
BTC Phase B7-stratum 5+6: wire stratum into main_btc.cpp + smoke test
frstrtr May 1, 2026
4841a35
BTC Phase B7-stratum 7: fundamental shutdown — signal_set + session c…
frstrtr May 1, 2026
8ca579b
BTC Phase B7-stratum 8a: PPLNS + ref_hash callback infrastructure
frstrtr May 1, 2026
b78bd7d
BTC Phase B7-stratum 8b/8c: c2pool v35 PPLNS coinbase + ref_hash OP_R…
frstrtr May 1, 2026
e110075
BTC Phase B7-stratum 8d/8e: wire PPLNS + ref_hash, smoke-test PASS
frstrtr May 1, 2026
52e8c9f
BTC Phase B7-stratum 9: ref_hash tracker-walk (network-acceptance gap…
frstrtr May 1, 2026
cd48d5d
BTC Phase B7-stratum 10: segwit witness commitment + mempool wiring
frstrtr May 1, 2026
3eb60e6
BTC Phase B7-stratum 11: sharechain WRITE path — local share creation…
frstrtr May 1, 2026
bab1370
BTC Phase B7-stratum 12: fix bitaxe share rejects (XOR version + merk…
frstrtr May 1, 2026
05f33d4
BTC Phase B7-stratum 12b: create_share lambda — match new merkle wire…
frstrtr May 1, 2026
dba6ee2
BTC Phase B7-stratum 12c: stop peer-banning share spam at diff-1
frstrtr May 1, 2026
f17fdda
BTC Phase B7-stratum 12d (Phase 12): dynamic share-target from tracker
frstrtr May 1, 2026
310ad7a
BTC Phase B7-mempool 13: wire recompute_unknown_fees + revalidate_inp…
frstrtr May 7, 2026
476ea16
freeze-diag (BTC): port [IOC-LAT] instrumentation to main_btc.cpp
frstrtr May 9, 2026
1e436f2
BTC: [MEM] periodic /proc/self/status logger every 60s
frstrtr May 11, 2026
cf44129
BTC HeaderChain: std::map → std::unordered_map for header indexes
frstrtr May 15, 2026
c28de32
BTC HeaderChain: slim IndexEntry, drop hash and prev_hash duplicates
frstrtr May 16, 2026
90355b3
Stratum send_notify_work: avoid 3 per-call deep copies via std::move
frstrtr May 16, 2026
817e849
BTC HeaderChain: lazy-load + persisted height index (Phase 1C)
frstrtr May 17, 2026
2191ca9
think-P2 verify progress: throttle 50→1000; BTC periodic malloc_trim
frstrtr May 24, 2026
967fb29
btc/stratum: a1 leak fix — hold shared_ptr to template txs, lazy-mate…
frstrtr Jun 4, 2026
c454757
fix(btc): link c2pool_hashrate OBJECT lib into btc target
frstrtr Jun 4, 2026
b8db2c9
feat(core/coin): add WorkView seam headers for family-1 web_server li…
frstrtr Jun 5, 2026
4c4b08b
btc: concrete core::coin::ICoinNode (CoinNode) for P2 WorkView seam
frstrtr Jun 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -212,3 +212,6 @@ external/**/relic_conf.h.in
external/**/relic_conf.h.old
# Doxygen output (e.g. external/dashbls/depends/mimalloc/docs/)
external/**/depends/**/docs/

# Release artifact staging area (built binaries, not source)
release-staging/
19 changes: 19 additions & 0 deletions src/c2pool/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,25 @@ target_link_libraries(c2pool_enhanced
)
target_link_libraries(c2pool_enhanced c2pool_hashrate pool) # OBJECT-lib SCC direct-naming (#22/#39)

# c2pool-btc: BTC SPV embedded p2pool — Phase B0 scaffold (stub entry).
# Library `btc` is a clone of `ltc` with namespace renamed and CMake targets
# adjusted; real entry-point port is in later B-phases.
# Links `ltc` transitively because core/web_server.cpp references LTC symbols
# (see comment at the bottom of this file). Untangling that is out of B0 scope.
add_executable(c2pool-btc main_btc.cpp)
target_compile_definitions(c2pool-btc PRIVATE C2POOL_VERSION="${C2POOL_GIT_VERSION}")
target_link_libraries(c2pool-btc
c2pool_node_enhanced
c2pool_payout
c2pool_merged_mining
core
ltc
btc
btc_stratum
nlohmann_json::nlohmann_json
${Boost_LIBRARIES}
)

# Windows: Boost.Asio requires Winsock libraries; /bigobj for large translation units
if(WIN32)
target_link_libraries(c2pool ws2_32 mswsock bcrypt dbghelp)
Expand Down
1,208 changes: 1,208 additions & 0 deletions src/c2pool/main_btc.cpp

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ set(source
addr_store.hpp addr_store.cpp
web_server.hpp web_server.cpp
stratum_server.hpp stratum_server.cpp
stratum_types.hpp
stratum_work_source.hpp
address_utils.hpp address_utils.cpp
leveldb_store.hpp leveldb_store.cpp
address_validator.hpp address_validator.cpp
Expand Down
64 changes: 64 additions & 0 deletions src/core/coin/node_iface.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#pragma once

// ---------------------------------------------------------------------------
// core::coin::ICoinNode -- generic per-coin node interface for src/core/web_server
// (family-1 link fix, P2 WorkView seam).
//
// web_server is SHARED core but historically forward-declared and held raw
// pointers to CONCRETE impl/ltc types (ltc::coin::NodeRPC,
// ltc::interfaces::Node, ltc::coin::CoinNodeInterface). That breaks the BTC link
// (ltc symbols absent; btc's per-coin types differ).
//
// SUPERSEDES the earlier template<class WorkData> INodeRPC/ICoinNode draft. The
// nm census proved web_server consumes a WorkData via only its agnostic slice
// (m_data/m_hashes/m_latency), never m_txs -- so getwork() does NOT need to
// return the per-coin WorkData across the seam. Instead the concrete coin node
// keeps the FULL WorkData coin-side (work.set(wd)) and hands core a WorkView.
// A single NON-TEMPLATE virtual now suffices, and the original "keep getwork
// parametric" gate is preserved where it matters: full WorkData (incl. m_txs)
// never leaves the coin.
//
// Each coin's concrete node (ltc::coin::CoinNode, btc::coin::CoinNode) inherits
// this base directly (direct-inherit, no adapter -- ltc-doge OK) and web_server
// holds one core::coin::ICoinNode* m_coin_node.
// ---------------------------------------------------------------------------

#include <string>

#include <core/coin/work_view.hpp>

namespace core::coin {

struct ICoinNode {
virtual ~ICoinNode() = default;

// Build (or fetch) a block template and return its coin-agnostic slice.
// The concrete impl makes the embedded-vs-rpc decision internally, calls
// work.set(wd) to retain the FULL per-coin WorkData coin-side, then moves
// m_data/m_hashes/m_latency into the returned view. Throws std::runtime_error
// if no template is available. (Folds web_server.cpp:2167-2172.)
virtual WorkView get_work_view() = 0;

// Submit a pre-serialised block as hex. Coin-agnostic 2-arg form: the
// LTC-MWEB extension block is NOT carried on this shared virtual -- mweb is
// LTC-specific and the concrete ltc node forwards to its 3-arg rpc overload
// with mweb="" coin-side. Sole caller (web_server.cpp:2730) passed mweb="",
// so dropping the slot cannot break MWEB submit. Returns true iff accepted.
virtual bool submit_block_hex(const std::string& block_hex,
bool ignore_failure) = 0;

// True iff this node has the embedded in-process template source.
// is_embedded() and has_rpc() are ORTHOGONAL -- a node may have BOTH (embedded
// preferred for get_work_view(), external RPC as fallback). Preserves the
// source labels (web_server.cpp:4423-4451) and the status JSON key "embedded"
// (web_server.cpp:4696).
virtual bool is_embedded() const = 0;

// True iff this node has an external coin-RPC client. ORTHOGONAL to
// is_embedded() -- may co-exist with embedded as the getwork fallback and is
// the sole path for submit_block_hex(). Backs the status JSON key "has_rpc"
// (web_server.cpp:4697).
virtual bool has_rpc() const = 0;
};

} // namespace core::coin
8 changes: 6 additions & 2 deletions src/core/coin/utxo_view_cache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,12 @@ class UTXOViewCache {
bool is_coinbase = first_tx;
first_tx = false;

// Detect HogEx (MWEB): last tx with m_hogEx flag → outputs are pegouts
bool is_hogex = tx.m_hogEx;
// Detect HogEx (MWEB): last tx with m_hogEx flag → outputs are pegouts.
// BTC's MutableTransaction has no m_hogEx (no MWEB) — gate by requires.
bool is_hogex = false;
if constexpr (requires { tx.m_hogEx; }) {
is_hogex = tx.m_hogEx;
}

if (!is_coinbase) {
// Spend inputs — save spent coins for undo
Expand Down
38 changes: 38 additions & 0 deletions src/core/coin/work_view.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#pragma once

// ---------------------------------------------------------------------------
// core::coin::WorkView -- the coin-AGNOSTIC slice of a per-coin WorkData that
// src/core/web_server actually consumes (family-1 link fix, P2 seam).
//
// nm census of web_server.cpp.o @ c4547575 (ci-steward, authoritative): the TU
// reads a WorkData via ONLY these three fields -- m_data, m_hashes, m_latency.
// It NEVER touches m_txs (grep 'm_txs' src/core/web_server.cpp == 0 hits). So
// the link break is not "abstract the interface", it is "stop crossing the seam
// with the payload": the per-coin WorkData (incl. vector<Transaction> m_txs)
// stays coin-side via work.set(wd); only this view crosses into core. That
// severs BOTH cluster A (ltc:: symbols) and cluster B (Transaction type) at
// once -- web_server.cpp.o then names no ltc:: symbol and no Transaction type.
//
// Field names mirror the concrete per-coin WorkData EXACTLY so every existing
// web_server line (wd.m_data / wd.m_hashes / wd.m_latency) is UNCHANGED.
// - m_data : getblocktemplate-shaped json the stratum/getwork path serves
// - m_hashes : merkle/branch hashes (vector<uint256>)
// - m_latency : template build latency; consumed at web_server.cpp:2381 as
// static_cast<double>(wd.m_latency) -> m_last_work_latency.store
// ---------------------------------------------------------------------------

#include <ctime>
#include <vector>

#include <nlohmann/json.hpp>
#include <core/uint256.hpp>

namespace core::coin {

struct WorkView {
nlohmann::json m_data;
std::vector<uint256> m_hashes;
std::time_t m_latency = 0;
};

} // namespace core::coin
83 changes: 65 additions & 18 deletions src/core/stratum_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ RateMonitor::get_datums_in_last(double dt) const {
/// Static member definition
std::atomic<uint64_t> StratumSession::job_counter_{0};

StratumServer::StratumServer(net::io_context& ioc, const std::string& address, uint16_t port, std::shared_ptr<MiningInterface> mining_interface)
StratumServer::StratumServer(net::io_context& ioc, const std::string& address, uint16_t port, std::shared_ptr<IWorkSource> mining_interface)
: ioc_(ioc)
, acceptor_(ioc)
, mining_interface_(mining_interface)
Expand Down Expand Up @@ -102,14 +102,41 @@ bool StratumServer::start()

void StratumServer::stop()
{
if (running_) {
try {
acceptor_.close();
running_ = false;
LOG_INFO << "StratumServer stopped";
} catch (const std::exception& e) {
LOG_ERROR << "Error stopping StratumServer: " << e.what();
if (!running_) return;

try {
// Stop accepting new connections first — no more sessions can spawn
// after this point, so the snapshot below is exhaustive.
boost::system::error_code ec;
acceptor_.cancel(ec);
acceptor_.close(ec);
running_ = false;

// Snapshot + clear the live-sessions set under the mutex, then close
// each one OUTSIDE the lock. cancel_timers() does asio operations
// (timer.cancel + socket.close) that should not run with our
// sessions_mutex_ held — the read-error handler will fire on the
// io_context thread and try to acquire sessions_mutex_ via
// unregister_session.
std::set<std::shared_ptr<StratumSession>> snapshot;
{
std::lock_guard<std::mutex> lk(sessions_mutex_);
snapshot = std::move(sessions_);
sessions_.clear();
}

for (auto& session : snapshot) {
try {
session->shutdown();
} catch (const std::exception& e) {
LOG_WARNING << "StratumSession shutdown threw: " << e.what();
}
}

LOG_INFO << "StratumServer stopped (closed " << snapshot.size()
<< " active session" << (snapshot.size() == 1 ? "" : "s") << ")";
} catch (const std::exception& e) {
LOG_ERROR << "Error stopping StratumServer: " << e.what();
}
}

Expand Down Expand Up @@ -275,7 +302,7 @@ void StratumServer::notify_all()
}

/// StratumSession Implementation
StratumSession::StratumSession(tcp::socket socket, std::shared_ptr<MiningInterface> mining_interface,
StratumSession::StratumSession(tcp::socket socket, std::shared_ptr<IWorkSource> mining_interface,
StratumServer* server)
: socket_(std::move(socket))
, mining_interface_(mining_interface)
Expand Down Expand Up @@ -917,16 +944,33 @@ nlohmann::json StratumSession::handle_submit(const nlohmann::json& params, const
response["error"] = nlohmann::json::array({20, "Invalid version mask", nullptr});
return response;
}
// Apply: keep non-rolling bits from job, take rolling bits from miner
effective_version = (job.version & ~version_rolling_mask_) | (miner_version_bits & version_rolling_mask_);
// BIP 320: version_bits is the XOR-difference between the miner's
// rolled version and the job version (per spec: "bits set by miner
// to be different from version field given by mining.notify").
// Recovery: effective = job ^ version_bits. ESP-Miner / bitaxe
// firmware sends version_bits this way (asic_result_task.c:60:
// `version_bits = rolled_version ^ active_job->version`). Earlier
// mask check ensures version_bits flips only mask-bits, so XOR
// only modifies the negotiated bits.
//
// Old REPLACE convention `(job & ~mask) | (bits & mask)` silently
// zeroed any job-version bits in the mask region (e.g. BIP 9
// signal bits) before OR'ing — produced a header version that
// bitaxe never hashed, every share rejected at vardiff gate.
effective_version = job.version ^ miner_version_bits;
} catch (...) {
LOG_WARNING << "[Stratum] Invalid version_bits hex from " << username_ << ": " << version_bits;
}
}

// Use gbt_prevhash (BE display hex) — SetHex converts to LE internal,
// matching build_block_from_stratum which the daemon accepts.
double share_difficulty = MiningInterface::calculate_share_difficulty(
// Per-coin PoW dispatch via IWorkSource virtual: LTC delegates to the
// existing static scrypt-based calculate_share_difficulty; BTC's
// BTCWorkSource implements this with SHA256d. Without this dispatch
// every BTC stratum submission gets a garbage scrypt-based diff and
// rejects at the vardiff gate.
double share_difficulty = mining_interface_->compute_share_difficulty(
job.coinb1, job.coinb2,
extranonce1_, extranonce2, ntime, nonce,
effective_version, job.gbt_prevhash, job.nbits, job.merkle_branches);
Expand All @@ -937,7 +981,7 @@ nlohmann::json StratumSession::handle_submit(const nlohmann::json& params, const

// Pool share difficulty (for P2P share creation threshold)
double pool_difficulty = 0.0;
uint32_t sb = mining_interface_->m_share_bits.load();
uint32_t sb = mining_interface_->get_share_bits();
if (sb != 0)
pool_difficulty = chain::target_to_difficulty(chain::bits_to_target(sb));

Expand Down Expand Up @@ -975,8 +1019,8 @@ nlohmann::json StratumSession::handle_submit(const nlohmann::json& params, const
snapshot.subsidy = job.subsidy;
snapshot.witness_commitment_hex = job.witness_commitment_hex;
snapshot.witness_root = job.witness_root;
snapshot.share_bits = mining_interface_->m_share_bits.load();
snapshot.share_max_bits = mining_interface_->m_share_max_bits.load();
snapshot.share_bits = mining_interface_->get_share_bits();
snapshot.share_max_bits = mining_interface_->get_share_max_bits();
// Pass frozen share fields through to ShareCreationParams
snapshot.frozen_ref.absheight = job.frozen_absheight;
snapshot.frozen_ref.abswork = job.frozen_abswork;
Expand Down Expand Up @@ -1317,7 +1361,7 @@ void StratumSession::send_notify_work(bool force_clean, const uint256* frozen_be
// coinbase/tx_data consistency. Overriding them caused GENTX validation
// failures on p2pool nodes (absheight, bits mismatch).
if (!cbr.snapshot.merkle_branches.empty()) {
merkle_branches_vec = cbr.snapshot.merkle_branches;
merkle_branches_vec = std::move(cbr.snapshot.merkle_branches);
merkle_branches = nlohmann::json::array();
for (const auto& h : merkle_branches_vec)
merkle_branches.push_back(h);
Expand All @@ -1340,7 +1384,7 @@ void StratumSession::send_notify_work(bool force_clean, const uint256* frozen_be
je.coinb1 = coinb1;
je.coinb2 = coinb2;
je.version = version_u32;
je.merkle_branches = merkle_branches_vec;
je.merkle_branches = std::move(merkle_branches_vec);
je.gbt_block_nbits = gbt_block_nbits;
active_jobs_[job_id] = std::move(je);
}
Expand Down Expand Up @@ -1379,7 +1423,10 @@ void StratumSession::send_notify_work(bool force_clean, const uint256* frozen_be
// Use tx_data from the atomic snapshot — NOT from the potentially stale
// tmpl fetched at the top of send_notify_work(). This ensures the block
// body transactions match the witness commitment and merkle branches.
je.tx_data = cbr.snapshot.tx_data;
// std::move because cbr is a local of this function and snapshot.tx_data
// is not referenced again after this assignment — saves a deep copy of
// the per-tx hex string vector on every notify (Option 2 fix).
je.tx_data = std::move(cbr.snapshot.tx_data);
}

// VARDIFF: do NOT override per-connection difficulty with pool share_bits.
Expand Down
24 changes: 17 additions & 7 deletions src/core/stratum_server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,18 @@

#include <core/log.hpp>
#include <core/uint256.hpp>
#include <core/stratum_work_source.hpp>
#include <c2pool/hashrate/tracker.hpp>

namespace core {

namespace net = boost::asio;
using tcp = net::ip::tcp;

// Forward declaration — defined in web_server.hpp
class MiningInterface;
// IWorkSource is the abstract interface stratum_server holds (defined in
// core/stratum_work_source.hpp). LTC's MiningInterface and BTC's
// btc::stratum::BTCWorkSource both implement it.
using IWorkSource = core::stratum::IWorkSource;

/// Sliding-window rate monitor matching p2pool's util.math.RateMonitor.
/// Records timestamped work datums for smooth hashrate estimation.
Expand Down Expand Up @@ -89,7 +92,7 @@ class StratumSession : public std::enable_shared_from_this<StratumSession>
boost::asio::streambuf buffer_;
std::deque<std::string> write_queue_; // async write queue (non-blocking)
bool writing_ = false; // true while an async_write is in flight
std::shared_ptr<MiningInterface> mining_interface_;
std::shared_ptr<IWorkSource> mining_interface_;
StratumServer* server_ = nullptr; // back-pointer for RateMonitor recording
std::string subscription_id_;
std::string extranonce1_;
Expand Down Expand Up @@ -117,7 +120,7 @@ class StratumSession : public std::enable_shared_from_this<StratumSession>
std::string coinb2;
uint32_t version{};
std::vector<std::string> merkle_branches;
std::vector<std::string> tx_data; // raw tx hex from GBT template
std::shared_ptr<const std::vector<std::string>> tx_data; // raw tx hex from GBT template (a1: shared/lazy)
std::string mweb; // MWEB extension data
bool segwit_active{false};
uint256 prev_share_hash; // share chain tip when this job was built
Expand Down Expand Up @@ -173,7 +176,7 @@ class StratumSession : public std::enable_shared_from_this<StratumSession>
boost::asio::steady_timer work_push_timer_;

public:
explicit StratumSession(tcp::socket socket, std::shared_ptr<MiningInterface> mining_interface,
explicit StratumSession(tcp::socket socket, std::shared_ptr<IWorkSource> mining_interface,
StratumServer* server = nullptr);
void start();

Expand Down Expand Up @@ -206,6 +209,13 @@ class StratumSession : public std::enable_shared_from_this<StratumSession>
// best_share_hash_fn() live. This prevents PPLNS recomputation race when
// best_share changes mid-iteration in notify_all().
void send_notify_work(bool force_clean = false, const uint256* frozen_best_share = nullptr);

// Graceful shutdown: cancel timers + close socket. The pending async_read
// fails with operation_aborted, the read handler runs the standard
// disconnect path (cancel_timers, unregister_stratum_worker, log). Idempotent.
// Called by StratumServer::stop() during process shutdown so no queued
// async handlers reference half-destroyed state when the io_context dies.
void shutdown() { cancel_timers(); }
private:
void start_periodic_work_push();
void schedule_work_push_timer();
Expand All @@ -220,7 +230,7 @@ class StratumServer
{
net::io_context& ioc_;
tcp::acceptor acceptor_;
std::shared_ptr<MiningInterface> mining_interface_;
std::shared_ptr<IWorkSource> mining_interface_;
std::string bind_address_;
uint16_t port_;
bool running_;
Expand All @@ -243,7 +253,7 @@ class StratumServer
mutable std::mutex cache_mutex_;

public:
StratumServer(net::io_context& ioc, const std::string& address, uint16_t port, std::shared_ptr<MiningInterface> mining_interface);
StratumServer(net::io_context& ioc, const std::string& address, uint16_t port, std::shared_ptr<IWorkSource> mining_interface);
~StratumServer();

bool start();
Expand Down
Loading
Loading