Not sure if we want to backport this, but if we do, this is the identical commits from https://github.com/bitcoin/bitcoin/pull/25737
[24.x] rpc: treat univalue type check error as RPC_TYPE_ERROR, not RPC_MISC_ERROR #26147
pull maflcko wants to merge 2 commits into bitcoin:24.x from furszy:2022_rpc_remove_type_check changing 15 files +30 −39-
maflcko commented at 10:22 AM on September 21, 2022: member
-
55566630c6
rpc: treat univalue type check error as RPC_TYPE_ERROR, not RPC_MISC_ERROR
By throwing a custom exception from `Univalue::checkType` (instead of a plain std::runtime_error) and catching it on the RPC server request handler. So we properly return RPC_TYPE_ERROR (-3) on arg type errors and not the general RPC_MISC_ERROR (-1).
-
e68d380797
rpc: remove unneeded RPCTypeCheckArgument checks
No-behavior change. Since #25629, we check the univalue type internally.
- fanquake added this to the milestone 24.0 on Sep 21, 2022
- fanquake added the label Backport on Sep 21, 2022
- fanquake approved
-
fanquake commented at 4:07 PM on September 21, 2022: member
ACK e68d380797918e655decb76fc11725197d6d5323
-
luke-jr commented at 7:35 PM on September 24, 2022: member
Concept ACK
-
in src/wallet/rpc/spend.cpp:1646 in e68d380797
1642 | @@ -1644,7 +1643,6 @@ RPCHelpMan walletcreatefundedpsbt() 1643 | bool rbf{wallet.m_signal_rbf}; 1644 | const UniValue &replaceable_arg = options["replaceable"]; 1645 | if (!replaceable_arg.isNull()) { 1646 | - RPCTypeCheckArgument(replaceable_arg, UniValue::VBOOL); 1647 | rbf = replaceable_arg.isTrue();
maflcko commented at 4:09 PM on September 29, 2022:This is a behavior change. Previously it would throw on non-bool, now it will translate it to false
luke-jr commented at 5:31 PM on September 29, 2022:Sounds like a bug in our UniValue fork that will affect master as well?
maflcko commented at 4:09 PM on September 29, 2022: memberidk, seems too risky
maflcko closed this on Sep 29, 2022luke-jr commented at 5:32 PM on September 29, 2022: memberWhat if we just take the first commit, and leave the redundant checks in place for 24.x?
maflcko commented at 5:34 PM on September 29, 2022: memberYes, first commit looks ok
bitcoin deleted a comment on Oct 1, 2022furszy deleted the branch on May 27, 2023bitcoin locked this on May 26, 2024LabelsMilestone
24.0
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-24 09:14 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-24 09:14 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me