Skip to content

Commit d0da3c2

Browse files
committed
Remove merged_payout_hash chain depth guard — match p2pool exactly
p2pool's compute_merged_payout_hash has NO height < CHAIN_LENGTH guard. It computes a real hash for any height > 0 using min(height, CHAIN_LENGTH). c2pool was returning zero for height < 400, causing ref_hash mismatch on shallow chains.
1 parent da0ba66 commit d0da3c2

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/impl/ltc/share_tracker.hpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,12 +1174,13 @@ class ShareTracker
11741174
if (height == 0)
11751175
return uint256{};
11761176

1177-
// Defer when chain is too shallow for a meaningful PPLNS window
1178-
if (height < static_cast<int32_t>(PoolConfig::real_chain_length()))
1179-
return uint256{};
1177+
// No chain depth guard — p2pool computes merged_payout_hash for ANY
1178+
// height > 0 using chain_length = min(height, REAL_CHAIN_LENGTH).
1179+
// The previous guard (height < CHAIN_LENGTH → return zero) caused
1180+
// ref_hash mismatch because p2pool computed a real hash while c2pool
1181+
// returned zero.
11801182

11811183
// Unlimited desired_weight — V36 exponential decay handles windowing.
1182-
// Must match get_merged_expected_payouts and p2pool's computation.
11831184
uint288 unlimited_weight;
11841185
unlimited_weight.SetHex("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
11851186
auto chain_len = std::min(height,

0 commit comments

Comments
 (0)