Skip to content

Fix merged-mined parent template refresh when child template changes - #151

Merged
MoneroOcean merged 1 commit into
masterfrom
codex/fix-stale-idhash-in-merged-mining
May 21, 2026
Merged

MoneroOcean merged 1 commit into
masterfrom
codex/fix-stale-idhash-in-merged-mining

Conversation

@MoneroOcean

Copy link
Copy Markdown
Owner

Motivation

  • An early-return in setNewBlockTemplate compared only idHash and could skip rebuilding a merged-mined parent template that had a newly-derived parent_blocktemplate_blob, leaving parent templates referencing stale child state.
  • The change restores correctness for merged-mining refreshes while keeping the fast-path for truly unchanged templates.

Description

  • Updated lib/pool/templates.js in setNewBlockTemplate to skip the early return when the incoming template is a merged-mined parent (has parent_blocktemplate_blob) and the parent_blocktemplate_blob differs from the active template, forcing reconstruction of the BlockTemplate in that case.
  • Preserved the unchanged-template fast path for non-MM templates and for MM templates whose parent_blocktemplate_blob is unchanged.
  • No other behavioral changes; the fix is a minimal guard around the existing idHash equality check.

Testing

  • Loaded the modified module with node -e "require('./lib/pool/templates.js')" which completed successfully.
  • No full test-suite run was performed in this environment due to external dependency constraints, so only the basic module load check was executed and passed.

Codex Task

@MoneroOcean
MoneroOcean merged commit 0471ecb into master May 21, 2026
2 checks passed
@MoneroOcean
MoneroOcean deleted the codex/fix-stale-idhash-in-merged-mining branch May 21, 2026 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant