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
8 changes: 5 additions & 3 deletions src/impl/btc/config_pool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,11 @@ class PoolConfig : protected core::Fileconfig

// V36+ COMBINED_DONATION_SCRIPT (P2SH: OP_HASH160 <hash160(redeem)> OP_EQUAL)
// 1-of-2 multisig: forrestv + frstrtr/c2pool dev key.
// LTC-specific (BTC stays at v35 per jtoomim — see plan v2 §3); kept
// here as inert byte data so get_donation_script() compiles for both
// BTC v35 (returns the P2PK above) and LTC v36 paths.
// LTC P2SH donation target. BTC now runs v36-active shares, but its
// donation leg intentionally stays the V35 P2PK above (forrestv
// canonical BTC-mainnet donation); this COMBINED P2SH is LTC-only,
// kept here as inert byte data so get_donation_script() compiles for
// both the BTC (P2PK) and LTC v36 (P2SH) paths.
// Address: MLhSmVQxMusLE3pjGFvp4unFckgjeD8LUA (LTC mainnet P2SH).
static constexpr std::array<uint8_t, 23> COMBINED_DONATION_SCRIPT = {
0xa9, // OP_HASH160
Expand Down
12 changes: 6 additions & 6 deletions src/impl/btc/share_check.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ uint256 share_init_verify(const ShareT& share, bool check_pow = true)

constexpr int64_t ver = ShareT::version;

if constexpr (ver >= btc::SEGWIT_ACTIVATION_VERSION)
if constexpr (ver >= btc::PoolConfig::SEGWIT_ACTIVATION_VERSION)
{
if constexpr (requires { share.m_segwit_data; })
{
Expand Down Expand Up @@ -563,7 +563,7 @@ uint256 share_init_verify(const ShareT& share, bool check_pow = true)
// segwit_data (optional)
if constexpr (requires { share.m_segwit_data; })
{
if constexpr (ver >= btc::SEGWIT_ACTIVATION_VERSION)
if constexpr (ver >= btc::PoolConfig::SEGWIT_ACTIVATION_VERSION)
{
// PossiblyNoneType: ALWAYS serialize (p2pool writes default when None)
if (share.m_segwit_data.has_value()) {
Expand Down Expand Up @@ -671,7 +671,7 @@ uint256 share_init_verify(const ShareT& share, bool check_pow = true)
// --- Merkle root ---
// For segwit-activated shares, use segwit_data.txid_merkle_link; otherwise merkle_link
uint256 merkle_root;
if constexpr (ver >= btc::SEGWIT_ACTIVATION_VERSION)
if constexpr (ver >= btc::PoolConfig::SEGWIT_ACTIVATION_VERSION)
{
if constexpr (requires { share.m_segwit_data; })
{
Expand Down Expand Up @@ -1163,7 +1163,7 @@ uint256 generate_share_transaction(const ShareT& share, TrackerT& tracker, bool
size_t n_outs = payout_outputs.size() + 1 /* donation */ + 1 /* OP_RETURN commitment */;
// Segwit commitment output (if applicable)
bool has_segwit = false;
if constexpr (ver >= btc::SEGWIT_ACTIVATION_VERSION)
if constexpr (ver >= btc::PoolConfig::SEGWIT_ACTIVATION_VERSION)
{
if constexpr (requires { share.m_segwit_data; })
{
Expand Down Expand Up @@ -1282,7 +1282,7 @@ uint256 generate_share_transaction(const ShareT& share, TrackerT& tracker, bool

if constexpr (requires { share.m_segwit_data; })
{
if constexpr (ver >= btc::SEGWIT_ACTIVATION_VERSION)
if constexpr (ver >= btc::PoolConfig::SEGWIT_ACTIVATION_VERSION)
{
// PossiblyNoneType: ALWAYS serialize (p2pool writes default when None).
// Must match share_init_verify — both paths must produce identical ref_hash.
Expand Down Expand Up @@ -1973,7 +1973,7 @@ uint256 verify_share(const ShareT& share, TrackerT& tracker)

if constexpr (requires { share.m_segwit_data; })
{
if constexpr (ver >= btc::SEGWIT_ACTIVATION_VERSION)
if constexpr (ver >= btc::PoolConfig::SEGWIT_ACTIVATION_VERSION)
{
// PossiblyNoneType: ALWAYS serialize (p2pool writes default when None)
if (share.m_segwit_data.has_value()) {
Expand Down
4 changes: 2 additions & 2 deletions src/impl/btc/share_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
#include <core/uint256.hpp>
#include <core/pack_types.hpp>
#include <core/pack.hpp>
#include "config_pool.hpp" // SSOT: PoolConfig::SEGWIT_ACTIVATION_VERSION

namespace btc
{

const uint64_t SEGWIT_ACTIVATION_VERSION = 17;

constexpr bool is_segwit_activated(uint64_t version)
{
return version >= SEGWIT_ACTIVATION_VERSION;
return version >= PoolConfig::SEGWIT_ACTIVATION_VERSION;
}

enum StaleInfo
Expand Down
Loading