Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions doc/stratum-v2.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 2 additions & 10 deletions src/sv2/template_provider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the commit message for the first commit, it's good to mention that interrupteWait() was added to Bitcoin Core v30.1 in bitcoin/bitcoin#33609

// 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();
}
}

Expand Down
Loading