Skip to content

stratum: blocks_found reward and fee from the mined coinbase - #108

Open
asilgulsar1 wants to merge 1 commit into
LayerTwo-Labs:mainfrom
asilgulsar1:block-reward
Open

asilgulsar1 wants to merge 1 commit into
LayerTwo-Labs:mainfrom
asilgulsar1:block-reward

Conversation

@asilgulsar1

Copy link
Copy Markdown

We run simplepool in solo mode for eCash.com (ECX, BIP300/301) behind the CUSF enforcer. These came out of a review of the solo path before we rely on it.

On a coinbasetxn template, job->value_sats is the negated coinbasetxn.fee. That is the sum of every output, and it is 0 when the server states no fee, in which case blocks_found got a NULL reward and fee. This now uses coinbase_template_reward() (the one spendable output, the value the builder actually split), as the pplns-coinbase path already does.

Test: test_found_block_reward_comes_from_the_coinbase (a template with value 0 must still record 49 BTC reward and 1 BTC fee at 200 bps).

Tested: make test passes on this branch alone, and the new test fails on main without the fix. This PR is independent of the five others opened alongside it, and all six merge together cleanly. Happy to add a CHANGELOG entry if you'd like one.

🤖 Generated with Claude Code

On a coinbasetxn template, job->value_sats is the negated coinbasetxn.fee:
the sum of every output, and 0 when the server states no fee, in which case
blocks_found got NULL reward and fee. Use coinbase_template_reward() (the one
spendable output, the value the builder actually split), as the
pplns-coinbase path already does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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