[rpc] Fix pruneheight help description in getblockchaininfo#11366
[rpc] Fix pruneheight help description in getblockchaininfo#11366esotericnonsense wants to merge 1 commit intobitcoin:masterfrom
Conversation
|
utACK 9da936232743a2235dade998be7f01ce0cf1b709. Clarity is good. |
|
utACK 9da936232743a2235dade998be7f01ce0cf1b709 Also consider in this PR moving the |
promag
left a comment
There was a problem hiding this comment.
Nit, I would reword commit and PR to something along [rpc] Fix pruneheight help description in getblockchaininfo.
Otherwise utACK 9da9362.
src/rpc/blockchain.cpp
Outdated
There was a problem hiding this comment.
Update to (only present if pruning is enabled). See this example for reference.
9da9362 to
887dcc4
Compare
|
Done and done, tested latest commit, appears in correct order. |
| obj.push_back(Pair("verificationprogress", GuessVerificationProgress(Params().TxData(), chainActive.Tip()))); | ||
| obj.push_back(Pair("chainwork", chainActive.Tip()->nChainWork.GetHex())); | ||
| obj.push_back(Pair("pruned", fPruneMode)); | ||
| if (fPruneMode) |
There was a problem hiding this comment.
Since this is touched, update as per developer notes? { in this line.
| if (fPruneMode) | ||
| { | ||
| CBlockIndex *block = chainActive.Tip(); | ||
| while (block && block->pprev && (block->pprev->nStatus & BLOCK_HAVE_DATA)) |
There was a problem hiding this comment.
Remove first condition block and add assert(block); above.
|
Suggest merging this with #11367 to avoid PR dependencies? |
|
Changes are now included in #11367. |
f6ffb14 [test] Add getblockchaininfo functional test (João Barbosa) fd8f45f [test] Add restart_node to BitcoinTestFramework (João Barbosa) Pull request description: Adds functional test for `getblockchaininfo`. Also deals with the fact that `pruneheight` is only in the response when pruning is enabled (related to #11366). Tree-SHA512: 56cdec0921f572874f2fdded0990d1722d1435c3ff9979e6bff1afdccdca6f8b214dbe8d7490cdac07b5758909db085132d14340de2cce943241f7ebde7e5b6c
f6ffb14 [test] Add getblockchaininfo functional test (João Barbosa) fd8f45f [test] Add restart_node to BitcoinTestFramework (João Barbosa) Pull request description: Adds functional test for `getblockchaininfo`. Also deals with the fact that `pruneheight` is only in the response when pruning is enabled (related to bitcoin#11366). Tree-SHA512: 56cdec0921f572874f2fdded0990d1722d1435c3ff9979e6bff1afdccdca6f8b214dbe8d7490cdac07b5758909db085132d14340de2cce943241f7ebde7e5b6c
f6ffb14 [test] Add getblockchaininfo functional test (João Barbosa) fd8f45f [test] Add restart_node to BitcoinTestFramework (João Barbosa) Pull request description: Adds functional test for `getblockchaininfo`. Also deals with the fact that `pruneheight` is only in the response when pruning is enabled (related to bitcoin#11366). Tree-SHA512: 56cdec0921f572874f2fdded0990d1722d1435c3ff9979e6bff1afdccdca6f8b214dbe8d7490cdac07b5758909db085132d14340de2cce943241f7ebde7e5b6c
This is a bit nitpicky, but the field isn't included in the JSON at all unless fPruneMode is set.
Alternatively we could return 0 (and remove 'pruned', which would then be pointless, but someone might be relying on that).