diff --git a/src/impl/btc/config_pool.hpp b/src/impl/btc/config_pool.hpp index 8d5a40e1b..6d72150e4 100644 --- a/src/impl/btc/config_pool.hpp +++ b/src/impl/btc/config_pool.hpp @@ -119,9 +119,11 @@ class PoolConfig : protected core::Fileconfig // V36+ COMBINED_DONATION_SCRIPT (P2SH: OP_HASH160 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 COMBINED_DONATION_SCRIPT = { 0xa9, // OP_HASH160 diff --git a/src/impl/btc/share_check.hpp b/src/impl/btc/share_check.hpp index 51d837b3b..a48a0771a 100644 --- a/src/impl/btc/share_check.hpp +++ b/src/impl/btc/share_check.hpp @@ -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; }) { @@ -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()) { @@ -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; }) { @@ -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; }) { @@ -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. @@ -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()) { diff --git a/src/impl/btc/share_types.hpp b/src/impl/btc/share_types.hpp index 5d5b914b2..0c32b7489 100644 --- a/src/impl/btc/share_types.hpp +++ b/src/impl/btc/share_types.hpp @@ -3,15 +3,15 @@ #include #include #include +#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