New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[rpc] mining: Omit uninitialized currentblockweight, currentblocktx #15383
Conversation
fa73310
to
fabf7eb
Compare
This should probably have release notes |
I am happy to write them after this is merged |
Concept ACK, change looks good too. Could have a test for -1 values? |
Looks good but
|
fabf7eb
to
fa60505
Compare
Added release notes, removed leftover variables, run clang format, ... Should be ready |
fa60505
to
fa7b9c1
Compare
@MarcoFalke could test null values now? |
fa7b9c1
to
fa3c0da
Compare
Why not omit the fields entirely? |
Omitting the fields was also my intuition (just going off the first line of the PR description). It's true that some software might not handle omitted fields well, but the same stuff would probably not handle the special json null either. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@luke-jr @gmaxwell it was suggested before #15383 (comment). Since it's an edge case, once set it's always present, I tend to prefer null value.
utACK fa3c0da.
fa3c0da
to
fa178a6
Compare
Made it to omit the key-value altogether |
utACK fa178a6. |
Concept ACK |
…ght, currentblocktx fa178a6 [rpc] mining: Omit uninitialized currentblockweight, currentblocktx (MarcoFalke) Pull request description: Previously we'd report "0", which could be mistaken for a valid number. E.g. the number of transactions is 0 or the block weight is 0, whatever that means. Tree-SHA512: ee94ab203a329e272211b726f4c23edec4b09c650ec363b77fd59ad9264165d73064f78ebb9e11b5c2c543b73c157752410a307655560531c7d5444d203aa0ea
Summary: This is a backport of Core [[bitcoin/bitcoin#15383 | PR15383]] Obviously currentblockweight => currentblocksize for us. Test Plan: ninja all check-all Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Subscribers: Fabien Differential Revision: https://reviews.bitcoinabc.org/D5945
Previously we'd report "0", which could be mistaken for a valid number. E.g. the number of transactions is 0 or the block weight is 0, whatever that means.