diff --git a/README.md b/README.md index 039c9264..3e098b82 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ dependencies. Usage ------------------------ -Download or compile Bitcoin Core v30.0 or later. Start it with: +Download or compile Bitcoin Core v30.2 or later. Start it with: ```sh bitcoin -m node -ipcbind=unix diff --git a/doc/stratum-v2.md b/doc/stratum-v2.md index 933a6f92..7ce17fef 100644 --- a/doc/stratum-v2.md +++ b/doc/stratum-v2.md @@ -1,5 +1,21 @@ # Stratum v2 +## Requirements + +### Bitcoin Core Version + +sv2-tp requires **Bitcoin Core v30.2 or later** compiled with IPC support +(`bitcoin-node` binary, not `bitcoind`). + +**Why v30.2?** +- v30.2 implements `interruptWait()` for clean shutdown of template waiting +- v30.2 properly enforces minimum block reserved weight + +To check your Bitcoin Core version: +```sh +bitcoin-node --version +``` + ## Design The Stratum v2 protocol specification can be found here: https://stratumprotocol.org/specification diff --git a/src/sv2/template_provider.cpp b/src/sv2/template_provider.cpp index af33dde8..13e135d9 100644 --- a/src/sv2/template_provider.cpp +++ b/src/sv2/template_provider.cpp @@ -131,16 +131,8 @@ void Sv2TemplateProvider::Interrupt() LogPrintLevel(BCLog::SV2, BCLog::Level::Trace, "Interrupt pending waitNext() calls..."); { LOCK(m_tp_mutex); - try { - for (auto& t : GetBlockTemplates()) { - t.second.second->interruptWait(); - } - } catch (const ipc::Exception& e) { - // Bitcoin Core v30 does not yet implement interruptWait(), fall back - // to just waiting until waitNext() returns. - LogPrintLevel(BCLog::SV2, BCLog::Level::Info, - "Interrupt received, waiting up to %d seconds before shutting down (-sv2interval)", - m_options.fee_check_interval.count()); + for (auto& t : GetBlockTemplates()) { + t.second.second->interruptWait(); } }