types: fix getblockstats doc for v21 and later#592
Conversation
111605e to
01fc4f2
Compare
01fc4f2 to
120427f
Compare
|
Great catch, my bad for letting that slip So in version v20 it says excluding. Also fix swtotal_weight and total_weight in and later because the phrase "divided by segwit scale factor (4)" was dropped from the Core docs at v21 and should not appear in v21+. |
The txs field in v21+ was documented as "excluding coinbase" but Core's docs changed the wording at v21 to "including coinbase". Add a getblockstats struct to v21 with the corrected doc. v22-v24 export from v21 now. Also fix swtotal_weight and total_weight in v21 and later because the phrase "divided by segwit scale factor (4)" was dropped from the Core docs at v21 and should not appear in v21 or later, including the model.
120427f to
d1c30f3
Compare
I just checked again to see why we get a different version where this changed and it changed between 20.1 and 20.2. We use 20.2 in types. |
|
I read the PR description and it reads like this is a docs only fix but then the patch diff is big and there are loads of code changes. Is this PR introducing new types just to fix the docs? If so this is a policy change for the repo and cannot be done lightly. Looks like this is tackling the problems outline in #457 and #59 but only partially. If so we need a more principled approach. |
Docs are wrong in getblockstats txs field.
The txs field counts all transactions in the block, including the coinbase. Core's source passes
block.vtx.size()directly, which includes the coinbase transaction at index 0. Bitcoin Core doc agrees.Example, I just called
Now I run
Returns 1 because that is the coinbase transaction.
Also,
swtotal_weightandtotal_weightfields say "divided by segwit scale factor (4)" but it was dropped from the Core docs at v21 and should not appear in v21 or later.