-
Notifications
You must be signed in to change notification settings - Fork 37.7k
rest: bugfix, fix crash error when calling /deploymentinfo
#27853
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
rest: bugfix, fix crash error when calling /deploymentinfo
#27853
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
Credits to @andrewtoth for noticing it! |
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.
ACK b550e9a
b550e9a
to
e19b922
Compare
Force-pushed addressing #27853 (comment) |
e19b922
to
7d452d8
Compare
Force-pushed addressing https://github.com/bitcoin/bitcoin/pull/27853/files#r1226690678 Thanks @stickies-v for the review. |
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.
ACK 7d452d8
ACK 7d452d8 |
Github-Pull: bitcoin#27853 Rebased-From: ce887ea
Github-Pull: bitcoin#27853 Rebased-From: 7d452d8
Backported in #27887. |
Github-Pull: bitcoin#27853 Rebased-From: ce887ea
Github-Pull: bitcoin#27853 Rebased-From: 7d452d8
…loymentinfo` 7d452d8 test: add coverage for `/deploymentinfo` passing a blockhash (brunoerg) ce887ea rest: bugfix, fix crash error when calling `/deploymentinfo` (brunoerg) Pull request description: Calling `/deploymentinfo` passing a valid blockhash makes bitcoind to crash. It happens because we're pushing a JSON value of type array when it expects type object. See: ```cpp jsonRequest.params = UniValue(UniValue::VARR); ``` ```cpp jsonRequest.params.pushKV("blockhash", hash_str); ``` This PR fixes it by changing `pushKV` to `push_back` and adds more test coverage. ACKs for top commit: achow101: ACK 7d452d8 stickies-v: ACK 7d452d8 Tree-SHA512: f01551e556aba2380c3eaed0bc59057304302c202d317d7c1eec5f7ef839851f672aed80819a8719cb1cbbad2aad735d6d44314ac7d6d98bff8217f5a16c312b
6233049 ci: Switch to `amd64` container in "ARM" task (Hennadii Stepanov) d845a3e test: add coverage for `/deploymentinfo` passing a blockhash (brunoerg) 72ead86 rest: bugfix, fix crash error when calling `/deploymentinfo` (brunoerg) 6f7a0ae ci: Use podman stop over podman kill (MarcoFalke) de56daa ci: Use podman for persistent workers (MarcoFalke) 71f626e ci: Prune dangling images on RESTART_CI_DOCKER_BEFORE_RUN (MarcoFalke) Pull request description: Currently backports: * #27777 * #27844 * #27853 * #27886 Effectively also backports: #27562. ACKs for top commit: stickies-v: ACK 6233049 Tree-SHA512: d0f3d5c4cd0cf9792f3270078b49ad6661e28e7a883f91e5981e8cfe95d01c6e415762ee2e3a5fea17d198299989a8b5412961c2cc788cef975b2ee45d84550c
Calling
/deploymentinfo
passing a valid blockhash makes bitcoind to crash. It happens because we're pushing a JSON value of type array when it expects type object. See:jsonRequest.params.pushKV("blockhash", hash_str);
This PR fixes it by changing
pushKV
topush_back
and adds more test coverage.